<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge" >
  <link rel="dns-prefetch" href="https://zouchanglin.cn">
  <title>Python语法学习日志 | Tim&#39;s Blog</title>
  <meta name="generator" content="hexo-theme-yilia-plus">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  
  <meta name="description" content="编译器与解释器将其他语言翻译为机器语言的工具被称为编译器编译器翻译的方式有两种，一个是编译、另一个是解释。两中方式的区别在于翻译时间的不同，当编译器以解释方式运行的时候，也称之为解释器">
<meta property="og:type" content="article">
<meta property="og:title" content="Python语法学习日志">
<meta property="og:url" content="https://zouchanglin.cn/2018/01/21/3674622550.html">
<meta property="og:site_name" content="Tim&#39;s Blog">
<meta property="og:description" content="编译器与解释器将其他语言翻译为机器语言的工具被称为编译器编译器翻译的方式有两种，一个是编译、另一个是解释。两中方式的区别在于翻译时间的不同，当编译器以解释方式运行的时候，也称之为解释器">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://img.zouchanglin.cn/blog/20200822/l6f0H4ybdU0i.png">
<meta property="og:image" content="https://img.zouchanglin.cn/blog/20200822/v5UxoBYpSbSL.png">
<meta property="og:image" content="https://img.zouchanglin.cn/blog/20200822/R76wcN9EnHVo.png">
<meta property="og:image" content="https://img.zouchanglin.cn/blog/20200822/5rBhUisDQ5mR.png">
<meta property="og:image" content="https://img.zouchanglin.cn/blog/20200822/4AxwCEPOQVjb.png">
<meta property="og:image" content="https://img.zouchanglin.cn/blog/20200822/wrVLuDV6PKqL.png">
<meta property="og:image" content="https://img.zouchanglin.cn/blog/20200822/YgzKBKdHfnhs.png">
<meta property="og:image" content="https://img.zouchanglin.cn/blog/20200822/dtSI60o0jmci.png">
<meta property="og:image" content="https://img.zouchanglin.cn/blog/20200822/FAEAxrTk8OQB.png">
<meta property="og:image" content="https://img.zouchanglin.cn/blog/20200822/kjgQbOtxzik5.png">
<meta property="og:image" content="https://img.zouchanglin.cn/blog/20200822/3rIU5I3LPUyp.png">
<meta property="og:image" content="https://img.zouchanglin.cn/blog/20200822/5AM9Cuy2JEDa.png">
<meta property="og:image" content="https://img.zouchanglin.cn/blog/20200822/oPoxjDVFxmsN.png">
<meta property="article:published_time" content="2018-01-21T14:55:41.000Z">
<meta property="article:modified_time" content="2020-09-19T13:53:25.241Z">
<meta property="article:author" content="Tim">
<meta property="article:tag" content="Python">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://img.zouchanglin.cn/blog/20200822/l6f0H4ybdU0i.png">
  
    <link rel="alternative" href="/atom.xml" title="Tim&#39;s Blog" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.ico">
  
  
    <link rel="apple-touch-icon" href="/apple-touch-icon-180x180.png">
  
  <link rel="stylesheet" type="text/css" href="/./main.e9e0ac.css">
  <style type="text/css">
    
    #container.show {
      background: linear-gradient(200deg,#a0cfe4,#e8c37e);
    }
  </style>
  

  

  
  

<script>
  (function () {
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
      bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    } else {
      bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
  })();

</script>



  

</head>

<body>
  <div id="container" q-class="show:isCtnShow">
    <canvas id="anm-canvas" class="anm-canvas"></canvas>
    <div class="left-col" q-class="show:isShow">
      



<div class="overlay" style="background: url(https://img.zouchanglin.cn/20201122140138.png); background-repeat: no-repeat;background-size: 100% 100%;-moz-background-size: 100% 100%;"></div>
<div class="intrude-less">
	<header id="header" class="inner">
		<a href="/" class="profilepic">
			<img src="https://img.zouchanglin.cn///20200413/kCxj1XROmHTt.png" class="js-avatar">
		</a>
		<hgroup>
			<h1 class="header-author"><a href="/">Tim</a></h1>
		</hgroup>
		
		<p class="header-subtitle">一枚野生程序员~</p>
		

		<nav class="header-menu">
			<ul>
			
				<li><a href="/" target="_blank">主页</a></li>
			
				<li><a href="/casual/" target="_blank">随笔</a></li>
			
				<li><a href="/categories" target="_blank">分类</a></li>
			
				<li><a href="/tags/" target="_blank">标签</a></li>
			
				<li><a href="/archives/" target="_blank">归档</a></li>
			
				<li><a href="/about/" target="_blank">关于</a></li>
			
			</ul>
		</nav>
		<nav class="header-smart-menu">
			
				
					<a q-on="click: openSlider(e, 'innerArchive')" href="javascript:void(0)">所有文章</a>
				
			
				
					<a q-on="click: openSlider(e, 'friends')" href="javascript:void(0)">工具</a>
				
			
		</nav>
		<nav class="header-nav">
			<div class="social">
				
					<a class="github" href="https://github.com/zouchanglin" title="GitHub" target="_blank"><i class="icon-github"></i></a>
				
					<a class="mail" href="mailto:zchanglin@163.com" title="NULL" target="_blank"><i class="icon-mail"></i></a>
				
					<a class="rss" href="/atom.xml" title="RSS订阅" target="_blank"><i class="icon-rss"></i></a>
				
					<a class="home" href="https://juejin.cn/user/914433802505767" title="subNav.title.home" target="_blank"><i class="icon-home"></i></a>
				
			</div>
		
		</nav>
	</header>		
</div>

    </div>
    <div class="mid-col" q-class="show:isShow,hide:isShow|isFalse">
      
      
<nav id="mobile-nav">
  	<div class="overlay js-overlay" style="background: #4d4d4d"></div>
	<div class="btnctn js-mobile-btnctn">
  		<div class="slider-trigger list" q-on="click: openSlider(e)"><i class="icon icon-sort"></i></div>
	</div>
	<div class="intrude-less">
		<header id="header" class="inner">
			<div class="profilepic">
				<a href="/">
					<img src="https://img.zouchanglin.cn///20200413/kCxj1XROmHTt.png" class="js-avatar">
				</a>
			</div>
			<hgroup>
			  <h1 class="header-author js-header-author">Tim</h1>
			</hgroup>
			
			<p class="header-subtitle"><i class="icon icon-quo-left"></i>一枚野生程序员~<i class="icon icon-quo-right"></i></p>
			
			
			
				
			
				
			
				
			
				
			
				
			
				
			
			
			
			<nav class="header-nav">
				<div class="social">
					
						<a class="github" target="_blank" href="https://github.com/zouchanglin" title="GitHub"><i class="icon-github"></i></a>
			        
						<a class="mail" target="_blank" href="mailto:zchanglin@163.com" title="NULL"><i class="icon-mail"></i></a>
			        
						<a class="rss" target="_blank" href="/atom.xml" title="RSS订阅"><i class="icon-rss"></i></a>
			        
						<a class="home" target="_blank" href="https://juejin.cn/user/914433802505767" title="subNav.title.home"><i class="icon-home"></i></a>
			        
				</div>
			</nav>

			<nav class="header-menu js-header-menu">
				<ul style="width: 70%">
				
				
					<li style="width: 16.666666666666668%"><a href="/">主页</a></li>
		        
					<li style="width: 16.666666666666668%"><a href="/casual/">随笔</a></li>
		        
					<li style="width: 16.666666666666668%"><a href="/categories">分类</a></li>
		        
					<li style="width: 16.666666666666668%"><a href="/tags/">标签</a></li>
		        
					<li style="width: 16.666666666666668%"><a href="/archives/">归档</a></li>
		        
					<li style="width: 16.666666666666668%"><a href="/about/">关于</a></li>
		        
				</ul>
			</nav>
		</header>				
	</div>
	<div class="mobile-mask" style="display:none" q-show="isShow"></div>
</nav>

      <div id="wrapper" class="body-wrap">
        <div class="menu-l">
          <div class="canvas-wrap">
            <canvas data-colors="#eaeaea" data-sectionHeight="100" data-contentId="js-content" id="myCanvas1"
              class="anm-canvas"></canvas>
          </div>
          <div id="js-content" class="content-ll">
            <article id="post-Python语法学习日志" class="article article-type-post " itemscope itemprop="blogPost">
  <div class="article-inner">
    
      <header class="article-header">
  
  
    <h1 class="article-title" itemprop="name">
      Python语法学习日志
    </h1>
  


  
  
        
        <span id="busuanzi_container_page_pv" style='display:none' class="archive-article-date">
              <i class="icon-smile icon"></i> 阅读数：<span id="busuanzi_value_page_pv"></span>次
        </span>

<a href="/2018/01/21/3674622550.html" class="archive-article-date">
        <time datetime="2018-01-21T14:55:41.000Z" itemprop="datePublished"><i class="icon-calendar icon"></i>2018-01-21</time>
</a>

  
  
    
<div style="margin-top:10px;">
  <span class="post-time">
    <span class="post-meta-item-icon">
      <!-- fonts.scss -->
      <!-- 百度字体平台:http://fontstore.baidu.com/static/editor/index.html -->
      <i class="icon-statistics"></i>
      <span class="post-meta-item-text"> 字数统计:</span>
      <span class="post-count">14.1k字</span>
    </span>
  </span>

  <span class="post-time">
    &nbsp; | &nbsp;
    <span class="post-meta-item-icon">
      <i class="icon-book icon"></i>
      <span class="post-meta-item-text"> 阅读时长≈</span>
      <span class="post-count">54分</span>
    </span>
  </span>
</div>


  
  </header>
  
  <div class="article-entry" itemprop="articleBody">
    

	
		<h2 id="编译器与解释器"><a href="#编译器与解释器" class="headerlink" title="编译器与解释器"></a>编译器与解释器</h2><p>将其他语言翻译为机器语言的工具被称为编译器<br>编译器翻译的方式有两种，一个是编译、另一个是解释。两中方式的区别在于翻译时间的不同，当编译器以解释方式运行的时候，也称之为解释器<br><img src="https://img.zouchanglin.cn/blog/20200822/l6f0H4ybdU0i.png" alt="mark"></p>
<a id="more"></a>
<h2 id="编译型与解释型速度"><a href="#编译型与解释型速度" class="headerlink" title="编译型与解释型速度"></a>编译型与解释型速度</h2><p>跨平台：每个操作系统都有对应的解释器，解释型跨平台性很好<br>速度：解释型速度相对来说较慢</p>
<blockquote>
<p>python的设计哲学:<strong>最好只有一个方法来做一件事请，越简单越明确越好</strong></p>
</blockquote>
<h2 id="Python的特点"><a href="#Python的特点" class="headerlink" title="Python的特点"></a>Python的特点</h2><ul>
<li>Python是完全面对对象的语言<br>函数、模块、数字、字符串都是对象，在Python中一切都是对象、完全支持继承、重载、多重继承、支持重载运算符，也支持泛型设计</li>
<li>Python拥有强大的标准库<br>Python语言的核心只包括数字、字符串、列表、字典、文件等常见类型和函数，而由Python标准库提供了系统管理、网络通信、文本处理、数据库接口、图形系统、XML处理等额外的功能</li>
<li>Python社区提供了大量的第三方模块，使用方法与标准库类似。它们的功能覆盖科学计算、人工智能、机器学习、Web开发、数据库接口、图形系统多个领域</li>
<li>Python是个格式非常严格的语言，每行代码完成一个动作、注意缩进错误、</li>
</ul>
<h2 id="Python解析器对应名称"><a href="#Python解析器对应名称" class="headerlink" title="Python解析器对应名称"></a>Python解析器对应名称</h2><p>Python2.X默认不支持中文，主要原因是编码不支持<br>Python2.X的解释器名称是Python<br>Python3.X的解释器名称是Python3</p>
<blockquote>
<p><strong>Python3是主流版本，Python3.0并没有向下兼容，但是语法层面相差并不是很大</strong></p>
</blockquote>
<h2 id="执行Python程序的三种方法"><a href="#执行Python程序的三种方法" class="headerlink" title="执行Python程序的三种方法"></a>执行Python程序的三种方法</h2><ul>
<li>解释器：python + 文件名</li>
<li>交互式：python的shell，exit()函数用来退出shell，Ctrl+d也可以退出（Windows下为Ctrl+Z）</li>
<li>IPython：是python的一个交互式shell</li>
</ul>
<h2 id="Python的注释"><a href="#Python的注释" class="headerlink" title="Python的注释"></a>Python的注释</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 单行注释</span></span><br><span class="line"><span class="string">"""</span></span><br><span class="line"><span class="string">这个是多行注释、也叫做块注释</span></span><br><span class="line"><span class="string">"""</span></span><br></pre></td></tr></table></figure>

<h2 id="Python的运算符"><a href="#Python的运算符" class="headerlink" title="Python的运算符"></a>Python的运算符</h2><table>
<thead>
<tr>
<th align="center">运算符</th>
<th align="center">作用</th>
</tr>
</thead>
<tbody><tr>
<td align="center"><code>/</code></td>
<td align="center">获得高精度结果</td>
</tr>
<tr>
<td align="center"><code>//</code></td>
<td align="center">或者整数除数</td>
</tr>
<tr>
<td align="center"><code>%</code></td>
<td align="center">获取余数</td>
</tr>
<tr>
<td align="center"><code>**</code></td>
<td align="center">幂，二次方</td>
</tr>
<tr>
<td align="center"><code>*</code></td>
<td align="center">此运算符还可以得到指定个数的字符串</td>
</tr>
</tbody></table>
<h2 id="Python程序的执行原理"><a href="#Python程序的执行原理" class="headerlink" title="Python程序的执行原理"></a>Python程序的执行原理</h2><p>（1）CPU会先把Python解释器程序复制到内存中<br>（2）Python解释器会根据语法规则，从上到下让CPU翻译Python代码<br>（3）负责执行翻译完成的代码<br><img src="https://img.zouchanglin.cn/blog/20200822/v5UxoBYpSbSL.png" alt="mark"></p>
<blockquote>
<p>Python解释器到底有多大？<br><strong>Linux的python2.7版本的解释器只有3.4M</strong></p>
</blockquote>
<hr>
<blockquote>
<p>注意：Python变量的定义不需要定义类型，解释器会自动推导数据类型<br><strong>type函数：查看变量的数据类型</strong><br>在Python2.x中：<br>type (2 ** 32) int类型<br>type ( 2 ** 64) long类型<br>在Python3.x中<br>type (2 ** 32) int类型<br>type ( 2 ** 64) int类型<br>Python3已经将原来的long也认为是int</p>
</blockquote>
<p>Python非常适合做数学计算，并且自动处理大数字，例如计算2的10000次方都可以轻松计算出来!<br><img src="https://img.zouchanglin.cn/blog/20200822/R76wcN9EnHVo.png" alt="mark"></p>
<h2 id="不同变量之间的计算"><a href="#不同变量之间的计算" class="headerlink" title="不同变量之间的计算"></a>不同变量之间的计算</h2><p>（1）数字之间可以直接计算，包括double与int等不同类型的数据，只要是数字就可以运算<br>（2） 如果变量是bool类型，True对应的数字为1，False对应的数字为0<br>（3）+ 运算符可以拼接字符串<br>（4）字符串变量可以和数字用*连接<br>（5）数字型变量和字符型变量之间不能进行其他的计算</p>
<h2 id="Python的输入函数"><a href="#Python的输入函数" class="headerlink" title="Python的输入函数"></a>Python的输入函数</h2><p>pwd = input(“请输入密码\n”)<br>注意：input函数只能得到字符串</p>
<h2 id="类型转换函数"><a href="#类型转换函数" class="headerlink" title="类型转换函数"></a>类型转换函数</h2><p>int(x)：将x转化为整数<br>float(x)：将x转化为浮点数</p>
<h3 id="print-函数的格式化输出"><a href="#print-函数的格式化输出" class="headerlink" title="print()函数的格式化输出"></a>print()函数的格式化输出</h3><p><code>%s</code>  字符串<br><code>%d</code> 有符号十进制整数，<code>%06d</code>表示输出的整数显示位数，不足的地方用0补全<br><code>%f</code>  浮点数，<code>%0.2f</code>表示小数点后只显示两位<br><code>%%</code> 输出%</p>
<blockquote>
<p><strong>注意这与C的printf函数的符号使用区别,这个是直接使用 <code>%</code>链接的</strong></p>
</blockquote>
<h2 id="查看python的关键字"><a href="#查看python的关键字" class="headerlink" title="查看python的关键字"></a>查看python的关键字</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">import keyword</span><br><span class="line">print(keyword.kwlist)</span><br></pre></td></tr></table></figure>
<p>[‘and’, ‘as’, ‘assert’, ‘break’, ‘class’, ‘continue’, ‘def’, ‘del’, ‘elif’, ‘else’, ‘except’, ‘exec’, ‘finally’, ‘for’, ‘from’, ‘global’, ‘if’, ‘import’, ‘in’, ‘is’, ‘lambda’, ‘not’, ‘or’, ‘pass’, ‘print’, ‘raise’, ‘return’, ‘try’, ‘while’, ‘with’, ‘yield’]</p>
<blockquote>
<p>import 关键字：导入工具包<br>python中变量名是区分大小写的</p>
</blockquote>
<h2 id="关于4空格与tab键"><a href="#关于4空格与tab键" class="headerlink" title="关于4空格与tab键"></a>关于4空格与tab键</h2><p>在开发python程序的时候Tab键和4个空格键不要混用，最好是直接用4个空格<br>if语句与下方的缩进是一个完整的代码块！</p>
<blockquote>
<p>注意输入的只能是字符串，需要类型转换</p>
</blockquote>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">age &#x3D; int(input(&quot;请输入年龄:&quot;))</span><br><span class="line">print(&quot;年龄：%d&quot; % age)</span><br></pre></td></tr></table></figure>

<h2 id="python中的逻辑运算符-and、or、not"><a href="#python中的逻辑运算符-and、or、not" class="headerlink" title="python中的逻辑运算符 and、or、not"></a>python中的逻辑运算符 and、or、not</h2><h2 id="pycharm使用技巧"><a href="#pycharm使用技巧" class="headerlink" title="pycharm使用技巧"></a>pycharm使用技巧</h2><p>Tab键可以统一向右缩进<br>Shift+Tab可以统一向左缩进</p>
<blockquote>
<p><strong>注意：if判断代码过长，可以加小括号换行，换行之后的条件必须加8个空格</strong></p>
</blockquote>
<p>##如何产生1-100的随机数？<br>（第一个参数必须小于第二个参数）</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">import random</span><br><span class="line">print(random.randint(0, 100))</span><br></pre></td></tr></table></figure>
<p><strong>python中的<code>+=</code>、<code>-=</code>、<code>/=</code>、<code>*=</code>、<code>%=</code>与C一样，<code>//=</code>是取整除、`</strong>=`是幂赋值运算符**</p>
<h2 id="python需要注意的地方"><a href="#python需要注意的地方" class="headerlink" title="python需要注意的地方"></a>python需要注意的地方</h2><ul>
<li>在循环中如果使用continue这个关键字，需要确认循环的计数是否修改，否则可能导致死循环</li>
<li>print()函数输出内容之后，会自动增加换行，print(“***”, end=””)</li>
<li>python的九九乘法表<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">i = <span class="number">1</span></span><br><span class="line"><span class="keyword">while</span> i &lt;= <span class="number">9</span>:</span><br><span class="line">    j = <span class="number">1</span></span><br><span class="line">    <span class="keyword">while</span> j &lt;= i:</span><br><span class="line">        print(<span class="string">"%d*%d=%d\t"</span>% (i, j, i*j), end = <span class="string">""</span>)</span><br><span class="line">        j += <span class="number">1</span></span><br><span class="line">    i += <span class="number">1</span></span><br><span class="line">    print()</span><br></pre></td></tr></table></figure>
<img src="https://img.zouchanglin.cn/blog/20200822/5rBhUisDQ5mR.png" alt="mark"></li>
</ul>
<h2 id="常见转义字符："><a href="#常见转义字符：" class="headerlink" title="常见转义字符："></a>常见转义字符：</h2><table>
<thead>
<tr>
<th align="center">符号</th>
<th align="center">原意</th>
</tr>
</thead>
<tbody><tr>
<td align="center"><code>\\</code></td>
<td align="center">反斜杠符号</td>
</tr>
<tr>
<td align="center"><code>\&#39;</code></td>
<td align="center">单引号</td>
</tr>
<tr>
<td align="center"><code>\&quot;</code></td>
<td align="center">双引号</td>
</tr>
<tr>
<td align="center"><code>\n</code></td>
<td align="center">换行</td>
</tr>
<tr>
<td align="center"><code>\t</code></td>
<td align="center">横向制表符</td>
</tr>
<tr>
<td align="center"><code>\r</code></td>
<td align="center">回车</td>
</tr>
</tbody></table>
<h2 id="函数封装"><a href="#函数封装" class="headerlink" title="函数封装"></a>函数封装</h2><p>封装函数的格式：注意函数命名应该符合命名规则</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">def 函数名():</span><br><span class="line">        封装的代码</span><br></pre></td></tr></table></figure>
<p>注意：不能在定义函数之前就使用函数，和C语言一致，或者先声明函数</p>
<h2 id="pycharm调试工具"><a href="#pycharm调试工具" class="headerlink" title="pycharm调试工具"></a>pycharm调试工具</h2><p>F8 Step Over 可以单步执行代码，会把函数调用看作是一行代码直接执行<br>F7 Step Into 可以单步执行代码，如果是函数，会进入函数内部</p>
<h2 id="函数的注释方式："><a href="#函数的注释方式：" class="headerlink" title="函数的注释方式："></a>函数的注释方式：</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">my_fun</span><span class="params">()</span>:</span></span><br><span class="line">    <span class="string">"""</span></span><br><span class="line"><span class="string">    打印乘法表</span></span><br><span class="line"><span class="string">    :return:无返回值</span></span><br><span class="line"><span class="string">    """</span></span><br><span class="line">    i = <span class="number">1</span></span><br><span class="line">    <span class="keyword">while</span> i &lt;= <span class="number">9</span>:</span><br><span class="line">        j = <span class="number">1</span></span><br><span class="line">        <span class="keyword">while</span> j &lt;= i:</span><br><span class="line">            print(<span class="string">"%d*%d=%d\t"</span>% (i, j, i*j), end = <span class="string">""</span>)</span><br><span class="line">            j += <span class="number">1</span></span><br><span class="line">        print()</span><br><span class="line">        i += <span class="number">1</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">my_fun()</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">def</span> 函数名<span class="params">(参数<span class="number">1</span>，参数<span class="number">2</span>，参数<span class="number">3</span>,...)</span>:</span></span><br><span class="line">        函数体</span><br></pre></td></tr></table></figure>
<h2 id="模块的概念"><a href="#模块的概念" class="headerlink" title="模块的概念"></a>模块的概念</h2><p>模块：以.py结尾的文件就是一个模块，本质就是工具包，里面有工具函数，要使用的时候用import导入即可<br>模块名也是标识符，必须符合命名规则，比如以数字开头的文件是无法导入的</p>
<blockquote>
<p>Pyc文件，c是compiled，即是编译过的意思</p>
</blockquote>
<h2 id="python中的数据类型"><a href="#python中的数据类型" class="headerlink" title="python中的数据类型"></a>python中的数据类型</h2><ul>
<li>数字型：整型、浮点型、布尔型、复数型（用于科学计算：比如平面场、波形问题）</li>
<li>非数字型：字符串、列表、元组、字典、</li>
</ul>
<p>非数字型都有的特点：<br>1、都是一个序列（sequence），也可以理解为容器<br>2、取值[]<br>3、遍历for in<br>4、计算长度、最大值、最小值、比较、删除<br>5、连接 + 和重复 *<br>6、支持切片</p>
<h2 id="列表：list"><a href="#列表：list" class="headerlink" title="列表：list"></a>列表：list</h2><p>在其他的编程语言叫做<code>数组</code></p>
<h3 id="列表的方法"><a href="#列表的方法" class="headerlink" title="列表的方法"></a>列表的方法</h3><p><img src="https://img.zouchanglin.cn/blog/20200822/4AxwCEPOQVjb.png" alt="mark"></p>
<ul>
<li>列表指定索引值越界,数组越界异常</li>
<li>extend方法把arr2（其他列表）中的内容追加到arr1里面 arr.extend(arr2)</li>
<li>默认删除(弹出)最后一个元素 arr.pop(),pop方法返回被移除的元素</li>
<li>remove方法可以删除指定内容的元素，但是只能删除第一个符合条件的数据,如果数据不存在就会报错</li>
</ul>
<blockquote>
<p>del关键字：使用delete关键字，简写为del<br>del关键字本质上是用来将一个变量从内存中删除的<br><strong>注意：如果使用del关键字讲一个变量从内存中删除，后续的代码就不能使用该变量了，在开发中最常用的是使用列表提供的方法去删除元素</strong></p>
</blockquote>
<h2 id="元组-：tuple"><a href="#元组-：tuple" class="headerlink" title="元组 ：tuple"></a>元组 ：tuple</h2><p>元组与列表类似，不同之处在于元组的元素不能修改，列表使用 [ ] 定义，二元组使用 ( ) 定义</p>
<p>如果只想定义只有一个元素的元组：<br>single_tuple = (4)   # 这种做法是错误的，解释器会误以为是加了括号的int类型<br>single_tuple = (4,)   # 这才是正确的另一方式，需要在后面加逗号</p>
<p>元组只有两个方法：<br>|       方法       |          作用          |<br>|:-:|:-:|<br>| 元组.count(数据) | 求该数据在元组中的个数 |<br>| 元组.index(索引) |    取出元组中的数据    |</p>
<p>元组中通常保存的数据是不同的，实际开发中，除非能确认元组中的数据类型，否则针对元组的循环遍历需求并不是很多，元组的应用场景：</p>
<ul>
<li>函数的参数和返回值，一个函数可以接受任意多个参数，或者一次返回多个数据</li>
<li>格式字符串，格式化字符串后面的()本质上就是一个元组</li>
<li>让列表不可以被修改，可以转换为元组</li>
</ul>
<h3 id="列表和元组之间的转换函数"><a href="#列表和元组之间的转换函数" class="headerlink" title="列表和元组之间的转换函数"></a>列表和元组之间的转换函数</h3><p>list(元组)、tuple(列表)</p>
<h2 id="字典-dictionary"><a href="#字典-dictionary" class="headerlink" title="字典 dictionary"></a>字典 dictionary</h2><ul>
<li>字典是除了列表以外的最灵活的数据类型，字典同样可以用来存储多个数据，通常字典用于存储一个物体的相关信息</li>
<li>字典和列表的区别<br>列表是有序的对象集合、字典是无序的对象集合</li>
<li>字典用 { } 定义</li>
<li>字典使用键值对存储数据、键值对之间使用 “,”分割<br>key是索引、value是数据<br>键和值之间使用“:”分割<br>键必须是唯一的，值可以取任意数据类型，键只能用字符串、数字或者元组</li>
</ul>
<p>字典的循环遍历：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">student = &#123;<span class="string">"name"</span>: <span class="string">"Tim"</span>,</span><br><span class="line">           <span class="string">"age"</span>: <span class="number">20</span>,</span><br><span class="line">           <span class="string">"scort"</span>: <span class="number">66.6</span>&#125;</span><br><span class="line"><span class="keyword">for</span> k <span class="keyword">in</span> student:</span><br><span class="line">    print(<span class="string">"%s:%s"</span>% (k, student[k]))</span><br></pre></td></tr></table></figure>
<p><img src="https://img.zouchanglin.cn/blog/20200822/wrVLuDV6PKqL.png" alt="mark"><br>字典和列表的混合使用</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">students = [&#123;<span class="string">"name"</span>: <span class="string">"Tim"</span>,<span class="string">"age"</span>: <span class="number">40</span>,<span class="string">"scort"</span>: <span class="number">66.6</span>&#125;,</span><br><span class="line">            &#123;<span class="string">"name"</span>: <span class="string">"LiLiLaLaLa"</span>,<span class="string">"age"</span>: <span class="number">30</span>,<span class="string">"scort"</span>: <span class="number">66</span>&#125;,</span><br><span class="line">            &#123;<span class="string">"name"</span>: <span class="string">"Android"</span>,<span class="string">"age"</span>: <span class="number">20</span>,<span class="string">"scort"</span>: <span class="number">59.9</span>&#125;,</span><br><span class="line">            ]</span><br><span class="line"><span class="keyword">for</span> student <span class="keyword">in</span> students:</span><br><span class="line">    <span class="keyword">for</span> k <span class="keyword">in</span> student:</span><br><span class="line">        print(<span class="string">"%s:%s"</span>% (k, student[k]))</span><br><span class="line">    print()</span><br></pre></td></tr></table></figure>
<p><img src="https://img.zouchanglin.cn/blog/20200822/YgzKBKdHfnhs.png" alt="mark"></p>
<h2 id="字符串"><a href="#字符串" class="headerlink" title="字符串"></a>字符串</h2><p>定义字符串使用<code>&quot; &quot;</code>和<code>&#39;&#39;</code>都是可以的，一般使用<code>&quot; &quot;</code>定义，和其他编程语言一致<br>注意：<br>1、虽然可以使用 <code>\”</code>或者 <code>\&#39;</code> 做字符串的转移，但是在实际开发中：</p>
<ul>
<li>如果字符串内部需要使用 <code>&quot;</code>，可以使用 <code>&#39;</code> 定义字符串</li>
<li>如果字符串内部需要使用  <code>&#39;</code> ，可以使用 <code>&quot;</code>定义字符串</li>
</ul>
<p>2、可以使用索引获取一个字符串中指定位置字符，索引计数从0开始<br>3、也可以使用for循环遍历字符</p>
<table>
<thead>
<tr>
<th>方法</th>
<th>功能</th>
</tr>
</thead>
<tbody><tr>
<td>len(字符串)</td>
<td>获取字符串的长度</td>
</tr>
<tr>
<td>字符串.count(字符串)</td>
<td>小字符串在大字符串中出现的次数</td>
</tr>
<tr>
<td>字符串.index(字符串)</td>
<td>获得小字符串第一次出现的索引</td>
</tr>
</tbody></table>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">str3 = <span class="string">"hello hello"</span></span><br><span class="line">print(len(str3)) <span class="comment"># 10</span></span><br><span class="line">print(str3.count(<span class="string">"hello"</span>)) <span class="comment"># 2</span></span><br><span class="line">print(str3.count(<span class="string">"abc"</span>)) <span class="comment"># 0 查找子串出现次数，传入不存在的子串得到结果为0</span></span><br><span class="line">print(str3.index(<span class="string">"lo"</span>)) <span class="comment"># 3</span></span><br><span class="line">print(str3.index(<span class="string">"abc"</span>)) <span class="comment"># 出错，查找子串位置是若传入不存在的子串就会出错</span></span><br></pre></td></tr></table></figure>

<h2 id="字符串的常见操作"><a href="#字符串的常见操作" class="headerlink" title="字符串的常见操作"></a>字符串的常见操作</h2><p>判断类型<br>|方法|功能|<br>| —- | —-|<br>|string.isspace()|如果string中只包含空格则返回True|<br>|string.isalnum()|如果string中至少有一个字符并且所有字符都是字母或数字则返回true|<br>|string.isalpha()|如果string中至少有一个字符并且所有字符都是字母则返回true|<br>|string.isdecimal()|如果string中只包含数字，则返回True，全角数字|<br>|string.isdigit()|如果string中只包含数字，则返回True，全角数字、(1)、\uoob2|<br>|string.isnumeric()|如果string中只包含数字，则返回True，全角数字、汉字数字|<br>|string.istitle()|如果string是标题化的(每个单词首字母大写)则返回True|<br>|string.islower()|如果string包含一个区分大小写的字符，并且这些(区分大小写的)字符都是小写，则返回True|<br>|string.isupper()|如果string包含一个区分大小写的字符，并且这些(区分大小写的)字符都是大写，则返回True|</p>
<p>查找和替换<br>|方法|功能|<br>| —- | —- |<br>|string.startwith(str)|如果string以str开头则返回True|<br>|string.endwith()|如果string以str结尾则返回true|<br>|string.find(str,start = 0,end = len(string))|检测str是否包含在string中，如果start和end指定范围，则只是检查是否在范围内部，若是则返回索引值，不是返回-1|<br>|string.rfind(str,start = 0,end = len(string))|与find函数类似，只不过是从右边开始查找|<br>|string.index(str,start = 0,end = len(string))|与find函数类似，只不过str不在string中会报错|<br>|string.rindex(str,start = 0,end = len(string))|与find函数类似，只不过是从右边开始|<br>|string.replace(old_str,new_str,num = string.count(old_str))|将string中的old_str替换成new_str，如果num指定，则替换不能超过num次|</p>
<p>大小写转换<br>|方法|功能|<br>| —- | —- |<br>|string.capitalize(str)|把字符串的第一个字母大写|<br>|string.title()|把字符串的每个单词首字母大写|<br>|string.lower()|转换string中的所有大写字母为小写|<br>|string.upper()|转换string中的所有小写字母为大写|<br>|string.swapcase()|反转string中的大小写|</p>
<p>文本对齐</p>
<table>
<thead>
<tr>
<th>方法</th>
<th>功能</th>
</tr>
</thead>
<tbody><tr>
<td>string.ljust(width)</td>
<td>返回原字符串右对齐，并使用空格填充至长度width的新字符串</td>
</tr>
<tr>
<td>string.ritle()</td>
<td>返回原字符串左对齐，并使用空格填充至长度width的新字符串</td>
</tr>
<tr>
<td>string.center()</td>
<td>返回原字符串居中对齐，并使用空格填充至长度width的新字符串</td>
</tr>
</tbody></table>
<p>去除空白字符<br>|      方法       |             功能             |<br>| ————- | ————————– |<br>| string.lstrip() |   截掉string左边的空白字符   |<br>| string.rstrip() |   截掉string右边的空白字符   |<br>| string.center() | 截掉string左右两边的空白字符 |</p>
<p>拆分和链接<br>|方法|功能|<br>| —– | —– |<br>|string.partition(str)|把string分成一个3元素的元组（str前面，str， str后面）|<br>|string.rpartition(str)|类似于partition函数，只不过是从右边查找|<br>|string.split(str=””,num)|以str为分隔符切片string，如果num有指定值，则仅分割num+1个字符串，str默认包含’\r’,’\t’,’\n’和空格|<br>|string.splitlines()|按照行(‘\r’,’\n’,’\r\n’)分隔，返回一个包含各行作为元素的列表|<br>|string.join(seq)|以string作为分隔符，将seq中所有的元素（的字符串表示）合并为一个新的字符串|</p>
<p>字符串中的转义字符<br><code>&#39;\t&#39;</code> 在控制台中输出一个制表符，协助在输出文本时<code>垂直方向</code>保持对其<br><code>&#39;\n&#39;</code> 在控制台输出一个换行符</p>
<blockquote>
<p>**制表符的功能是在不使用表格的情况下在垂直方向按列对齐文本</p>
</blockquote>
<table>
<thead>
<tr>
<th>转义字符</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td><code>\</code>\</td>
<td>反斜杠符号</td>
</tr>
<tr>
<td><code>\&#39;</code></td>
<td>单引号</td>
</tr>
<tr>
<td><code>\&quot;</code></td>
<td>双引号</td>
</tr>
<tr>
<td><code>\n</code></td>
<td>换行</td>
</tr>
<tr>
<td><code>\</code>t</td>
<td>横向制表符</td>
</tr>
<tr>
<td><code>\r</code></td>
<td>回车</td>
</tr>
</tbody></table>
<p>判断是否是数字的三种方法：（开发中常用的还是isdecimal方法）</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 都不能判断小数</span></span><br><span class="line">num_str = <span class="string">"123"</span></span><br><span class="line">print(num_str.isdecimal())</span><br><span class="line">print(num_str.isdigit())</span><br><span class="line">print(num_str.isnumeric())</span><br><span class="line"></span><br><span class="line"><span class="comment"># isdigit与isnumeric的强大之处</span></span><br><span class="line">num_str2 = <span class="string">"⑴"</span></span><br><span class="line">print(num_str2.isdecimal())</span><br><span class="line">print(num_str2.isdigit())</span><br><span class="line">print(num_str2.isnumeric())</span><br><span class="line"></span><br><span class="line"><span class="comment"># isnumeric的强大之处</span></span><br><span class="line">num_str3 = <span class="string">"一千零一"</span></span><br><span class="line">print(num_str3.isdecimal())</span><br><span class="line">print(num_str3.isdigit())</span><br><span class="line">print(num_str3.isnumeric())</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">print(str.find(<span class="string">"abc"</span>)) <span class="comment"># 查找不存在的字符串返回-1，index方法则会报错</span></span><br><span class="line">print(str.replace(<span class="string">"world"</span>, <span class="string">"python"</span>)) <span class="comment"># replace方法执行完毕会返回一个字符串，而不会改变源字符串</span></span><br></pre></td></tr></table></figure>
<p>字符串去除空格、切割字符串、拼接字符串</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">print(str.strip()) <span class="comment"># 去除所有的空格</span></span><br><span class="line">print(str.lstrip()) <span class="comment"># 去除左边的空格</span></span><br><span class="line">print(str.rstrip()) <span class="comment"># 去除右边的空格</span></span><br><span class="line"></span><br><span class="line">str = <span class="string">"hello#world#java#python"</span></span><br><span class="line">split = str.split(<span class="string">"#"</span>) <span class="comment"># 按照#切割字符串，默认按照不可见字符进行切割</span></span><br><span class="line">print(split)</span><br><span class="line">join = <span class="string">"#"</span>.join(split) <span class="comment"># 按照#合并字符串</span></span><br><span class="line">print(join)</span><br></pre></td></tr></table></figure>

<p>下标和切片<br>注意可以使用倒序的方式来使用下标</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 将字符串转为列表,再得到逆序的字符串</span></span><br><span class="line">str = <span class="string">"abcdefg"</span></span><br><span class="line">str_list = list(str)</span><br><span class="line">str_list.reverse()</span><br><span class="line">print(<span class="string">''</span>.join(str_list))</span><br><span class="line"></span><br><span class="line"><span class="comment"># 直接使用字符串切片功能逆转字符串</span></span><br><span class="line">str = <span class="string">"abcdefgh"</span></span><br><span class="line">print(str[::<span class="number">-1</span>])</span><br><span class="line">print(str[<span class="number">-1</span>::<span class="number">-1</span>])</span><br><span class="line">Python的内置函数</span><br></pre></td></tr></table></figure>
<table>
<thead>
<tr>
<th align="center">函数</th>
<th align="center">描述</th>
<th align="center">备注</th>
</tr>
</thead>
<tbody><tr>
<td align="center">len(item)</td>
<td align="center">计算容器中元素个数</td>
<td align="center"></td>
</tr>
<tr>
<td align="center">del(item)</td>
<td align="center">删除变量</td>
<td align="center">del有两种方式</td>
</tr>
<tr>
<td align="center">max(item)</td>
<td align="center">返回容器中元素最大值</td>
<td align="center">如果是字典、只是针对key比较</td>
</tr>
<tr>
<td align="center">min(item)</td>
<td align="center">返回容器中元素最小值</td>
<td align="center">如果是字典、只是针对key比较</td>
</tr>
<tr>
<td align="center">cmp(item1,item2)</td>
<td align="center">比较两个值，-1 小于/ 0相等/ 1大于</td>
<td align="center">Python3.x取消了cmp函数</td>
</tr>
</tbody></table>
<p>注意：字符串比较符合以下规则：”0”&lt;”A”&lt;”a”</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 针对列表和元组进行切片</span></span><br><span class="line">print([<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>][<span class="number">1</span>:<span class="number">3</span>])</span><br><span class="line">print((<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>)[<span class="number">1</span>:<span class="number">3</span>])</span><br><span class="line"></span><br><span class="line"><span class="comment"># 由于字典是一个无序集合，使用键值对的方式保存数据，所以字典是无法切片的</span></span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 列表和元组乘法运算</span></span><br><span class="line">print([<span class="number">1</span>, <span class="number">2</span>]*<span class="number">5</span>)</span><br><span class="line">print((<span class="number">1</span>, <span class="number">2</span>)*<span class="number">5</span>)</span><br><span class="line"><span class="comment"># print(&#123;"a": "z"&#125;) error,因为key是唯一的</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 列表</span></span><br><span class="line">l_list = [<span class="number">1</span>, <span class="number">2</span>]</span><br><span class="line">l_list2 = [<span class="number">3</span>, <span class="number">4</span>]</span><br><span class="line">print(l_list+l_list2) <span class="comment"># 使用加号不会改变原有的列表，而是产生新的列表</span></span><br><span class="line">l_list.extend(l_list2) <span class="comment"># 此方法无返回值，直接改变l_list</span></span><br><span class="line">l_list.append(<span class="number">5</span>)</span><br><span class="line">l_list.append([<span class="number">6</span>, <span class="number">7</span>, <span class="number">8</span>]) <span class="comment"># append方法会把列表当成一个元素插入到列表中</span></span><br><span class="line">print(l_list)</span><br><span class="line"></span><br><span class="line">l_list3 = (<span class="number">1</span>, <span class="number">2</span>)</span><br><span class="line">l_list4 = (<span class="number">3</span>, <span class="number">4</span>)</span><br><span class="line">print(l_list3+l_list4)</span><br></pre></td></tr></table></figure>

<p>int 与 not in运算符</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">print(<span class="string">"a"</span> <span class="keyword">in</span> <span class="string">"abcde"</span>)</span><br><span class="line">print(<span class="string">"a"</span> <span class="keyword">not</span> <span class="keyword">in</span> <span class="string">"abcde"</span>)</span><br></pre></td></tr></table></figure>
<p><img src="https://img.zouchanglin.cn/blog/20200822/dtSI60o0jmci.png" alt="mark"><br>完整的for循环</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">for</span> 变量 <span class="keyword">in</span> 集合:</span><br><span class="line">    循环体代码</span><br><span class="line"><span class="keyword">else</span>:</span><br><span class="line">    没有通过<span class="keyword">break</span>退出循环，只有当循环结束后才会执行的代码</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">num = [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>]</span><br><span class="line"><span class="keyword">for</span> n <span class="keyword">in</span> num:</span><br><span class="line">    <span class="keyword">if</span> n == <span class="number">3</span>:</span><br><span class="line">        <span class="keyword">break</span></span><br><span class="line">    print(n)</span><br><span class="line"><span class="keyword">else</span>:</span><br><span class="line">    print(<span class="string">"完毕"</span>)</span><br></pre></td></tr></table></figure>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">num = [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>]</span><br><span class="line"><span class="keyword">for</span> n <span class="keyword">in</span> num:</span><br><span class="line">    print(n)</span><br><span class="line"><span class="keyword">else</span>:</span><br><span class="line">    print(<span class="string">"完毕"</span>)</span><br></pre></td></tr></table></figure>
<h2 id="其他"><a href="#其他" class="headerlink" title="其他"></a>其他</h2><p>pass 关键字：pass代表空语句，就和java中的；是一样的<br>TODO(开发者姓名/开发者邮件) 功能描述<br>Linux上的Shebang符号(#!)<br>在要运行的python主文件在第一行加入 #! /usr/bin/python3即可，然后修改python文件权限为可执行！</p>
<h2 id="全局变量"><a href="#全局变量" class="headerlink" title="全局变量"></a>全局变量</h2><ol>
<li>在函数内部无法修改全局变量的值</li>
<li>即使修改，解释器也会认为是在函数内部定义了一个与全局变量名称一样的局部变量</li>
<li>如果在函数内部需要修改全局变量，需要使用global关键字</li>
</ol>
<h2 id="代码结构的定义规范"><a href="#代码结构的定义规范" class="headerlink" title="代码结构的定义规范"></a>代码结构的定义规范</h2><ol>
<li>shebang</li>
<li>import 模块</li>
<li>全局变量</li>
<li>函数定义</li>
<li>执行代码</li>
</ol>
<blockquote>
<p>注意：定义全局变量的时候应该在变量名前面加<code>g_</code>或者<code>gl_</code>的前缀</p>
</blockquote>
<h2 id="函数返回值"><a href="#函数返回值" class="headerlink" title="函数返回值"></a>函数返回值</h2><ol>
<li>返回多个值返回元组即可</li>
<li>使用多个变量接受返回的元组中的数据，格式<code>变量一，变量二... = 函数</code></li>
<li>使用多变量接受结果的时候，变量的个数应该和元组中元素的个数保持一致，否则会报错</li>
</ol>
<h2 id="Python交换数字的特殊方式"><a href="#Python交换数字的特殊方式" class="headerlink" title="Python交换数字的特殊方式"></a>Python交换数字的特殊方式</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">a = <span class="number">10</span></span><br><span class="line">b = <span class="number">20</span></span><br><span class="line"><span class="comment"># 方式一</span></span><br><span class="line">a = a+b</span><br><span class="line">b = a-b</span><br><span class="line">a = a-b</span><br><span class="line">print(<span class="string">"a = %d,b = %d"</span> % (a, b))</span><br><span class="line"><span class="comment"># 方式二</span></span><br><span class="line">a, b = (b, a)</span><br><span class="line">print(<span class="string">"a = %d,b = %d"</span> % (a, b))</span><br></pre></td></tr></table></figure>

<h2 id="函数的参数"><a href="#函数的参数" class="headerlink" title="函数的参数"></a>函数的参数</h2><ol>
<li>无论是可变的还是不可变的参数，针对参数使用<code>赋值语句</code>，都不会影响到调用函数时传递的实参变量，影响范围只在函数内部</li>
<li>如果传递的参数是<code>可变类型</code>，在函数内部，使用<code>方法</code>修改了数据的内容，这样才会影响到外部数据</li>
<li>列表变量使用<code>+=</code>符号本质是在调用列表的<code>extend</code>方法，所以仍然会修改函数外部的实参</li>
</ol>
<h2 id="缺省参数"><a href="#缺省参数" class="headerlink" title="缺省参数"></a>缺省参数</h2><h3 id="定义"><a href="#定义" class="headerlink" title="定义"></a>定义</h3><ul>
<li>定义函数时，可以给某个参数制定一个<strong>默认值</strong>，具有默认值的参数就叫缺省参数</li>
<li>函数缺省参数的作用就是<strong>将常见的值设置为参数的缺省值</strong>，从而简化函数的调用</li>
</ul>
<h3 id="使用场景"><a href="#使用场景" class="headerlink" title="使用场景"></a>使用场景</h3><ul>
<li>在参数后面使用赋值语句，可以指定参数的缺省值，在指定缺省值的时候需要使用<strong>最常见的值</strong>作为默认值</li>
<li>如果一个参数的值<strong>不能确定</strong>，这不应该设置默认值 </li>
</ul>
<h3 id="注意点"><a href="#注意点" class="headerlink" title="注意点"></a>注意点</h3><ul>
<li>缺省参数的定义位置必须在参数列表末尾</li>
<li>调用带有多个缺省参数的函数时，需要指定参数名，这样解释器才能知道参数的对应关系</li>
</ul>
<h2 id="多值参数"><a href="#多值参数" class="headerlink" title="多值参数"></a>多值参数</h2><p>定义支持多值参数的函数</p>
<ul>
<li>有时可能需要<strong>一个函数</strong>能够处理的参数个数是不确定的，这个时候就可以使用多值参数</li>
<li><code>python</code>中有两种多值参数：<ul>
<li>参数名前面加一个<code>*</code>可以接受元组</li>
<li>参数名前面加两个<code>*</code>可以接受字典   </li>
</ul>
</li>
<li>一般给多值参数命名时，习惯使用以下两个名字<ul>
<li><code>*args</code> – 存放<strong>元组</strong>参数，前面有一个<code>*</code></li>
<li><code>**kwargs</code>– 存放 <strong>字典</strong>参数,前面有两个<code>*</code></li>
</ul>
</li>
<li><code>args</code>是<code>arguments</code>的缩写，有变量的含义</li>
<li><code>kw</code>是<code>keyword</code>的缩写，<code>kwargs</code>可以记忆为<strong>键值对参数</strong><blockquote>
<p>多值参数常用于框架当中！</p>
</blockquote>
</li>
</ul>
<h2 id="元组的字典的拆包"><a href="#元组的字典的拆包" class="headerlink" title="元组的字典的拆包"></a>元组的字典的拆包</h2><ul>
<li><p>再调用带有多值参数的函数时，如果希望：</p>
<ul>
<li>将一个<strong>元组变量</strong>，直接传递给<code>args</code></li>
<li>将一个<strong>字典变量</strong>，直接传递给<code>kwargs</code></li>
</ul>
</li>
<li><p>就可以使用<strong>拆包</strong>，简化参数的传递，拆包的方式是：</p>
<ul>
<li>在<strong>元组变量</strong>前，增加一个<code>*</code></li>
<li>在<strong>字典变量</strong>前，增加两个<code>*</code></li>
</ul>
</li>
<li><p>使用示例：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">demo</span><span class="params">(*args, **kwargs)</span>:</span></span><br><span class="line">    print(args)</span><br><span class="line">    print(kwargs)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">gl_nums = (<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>)</span><br><span class="line">gl_dict = &#123;<span class="string">"name"</span>: <span class="string">"Tim"</span>, <span class="string">"age"</span>: <span class="number">18</span>&#125;</span><br><span class="line"></span><br><span class="line">demo(gl_nums, gl_dict)</span><br></pre></td></tr></table></figure>
<p><img src="https://img.zouchanglin.cn/blog/20200822/FAEAxrTk8OQB.png" alt="mark"></p>
<p>很显然这不是我们所期望看到的结果，因为解释器把字典当做元组的一个元素了，此时便需要拆包</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">demo</span><span class="params">(*args, **kwargs)</span>:</span></span><br><span class="line">    print(args)</span><br><span class="line">    print(kwargs)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">gl_nums = (<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>)</span><br><span class="line">gl_dict = &#123;<span class="string">"name"</span>: <span class="string">"Tim"</span>, <span class="string">"age"</span>: <span class="number">18</span>&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment"># demo(gl_nums, gl_dict)</span></span><br><span class="line"><span class="comment"># 拆包的做法</span></span><br><span class="line">demo(*gl_nums,**gl_dict)</span><br><span class="line"><span class="comment"># 不拆包的做法</span></span><br><span class="line">demo(<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, name=<span class="string">"Tim"</span>, age=<span class="number">18</span>)</span><br></pre></td></tr></table></figure>
<p><img src="https://img.zouchanglin.cn/blog/20200822/kjgQbOtxzik5.png" alt="mark"></p>
</li>
</ul>
<h2 id="函数递归"><a href="#函数递归" class="headerlink" title="函数递归"></a>函数递归</h2><ol>
<li>函数调用自身称为递归，函数内部的代码是相同的，只是针对参数不同处理的结果也不同</li>
<li>当参数满足一个条件时，函数不再执行，这是递归的出口</li>
</ol>
<h1 id="面向对象"><a href="#面向对象" class="headerlink" title="面向对象"></a>面向对象</h1><h2 id="dir内置函数"><a href="#dir内置函数" class="headerlink" title="dir内置函数"></a>dir内置函数</h2><p>使用内置函数<code>dir</code>传入<strong>标识符/数据</strong>,可以查看对象内部的<strong>所有属性和方法</strong></p>
<p>提示<code>__方法名__</code>格式的方法是python提供的内置方法/属性</p>
<table>
<thead>
<tr>
<th>序号</th>
<th>方法名</th>
<th>类型</th>
<th>作用</th>
</tr>
</thead>
<tbody><tr>
<td>01</td>
<td>__new__</td>
<td>方法</td>
<td>创建对象时，会被自动调用</td>
</tr>
<tr>
<td>02</td>
<td>__init__</td>
<td>方法</td>
<td>对象被初始化时，会被自动调用</td>
</tr>
<tr>
<td>03</td>
<td>__del__</td>
<td>方法</td>
<td>对象被从内存中销毁前，会被自动调用</td>
</tr>
<tr>
<td>04</td>
<td>__str__</td>
<td>方法</td>
<td>返回对象的描述信息，print函数输出使用</td>
</tr>
</tbody></table>
<p><strong>所以在Python中方法也是对象！！</strong></p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">MyClass</span>:</span></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">fun</span><span class="params">(self)</span>:</span></span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># 创建对象</span></span><br><span class="line">obj = MyClass()</span><br><span class="line"><span class="comment"># print函数会直接打印出对象所属类以及地址</span></span><br><span class="line">print(obj)</span><br><span class="line"><span class="comment"># 使用id函数获取 对象的内存地址</span></span><br><span class="line">address = id(obj)</span><br><span class="line">print(address)</span><br><span class="line"><span class="comment"># 以16进制打印地址</span></span><br><span class="line">print(<span class="string">"%x"</span> % address)</span><br></pre></td></tr></table></figure>

<h2 id="self参数"><a href="#self参数" class="headerlink" title="self参数"></a>self参数</h2><p>在python中要给对象设置属性，非常容易，但是不推荐使用，因为对象的属性应该封装在类的内部，设置方法是<code>对象.属性 = 值</code>，这种方式虽然简单但是不推荐使用！</p>
<p><strong>哪一个对象调用的方法，self就是哪一个对象的引用</strong></p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Student</span>:</span></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">study</span><span class="params">(self)</span>:</span></span><br><span class="line">        print(<span class="string">"%s开始学习"</span> % self.name)</span><br><span class="line">        self.eat()</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">eat</span><span class="params">(self)</span>:</span></span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">s1 = Student()</span><br><span class="line">s1.name = <span class="string">"Tim"</span></span><br><span class="line">s1.study()</span><br></pre></td></tr></table></figure>

<p><strong>self参数也可以访问到类中属性和方法</strong>，在开发中不推荐在类的外部给类增加属性，如果在运行时没找到属性，程序就会报错。所有属性都应该封装在类的内部</p>
<h2 id="init-方法"><a href="#init-方法" class="headerlink" title="__init__方法"></a>__init__方法</h2><p><strong><code>__init__</code>方法相当于Java中的构造方法！</strong></p>
<ol>
<li><p>当使用<code>类名()</code>创建对象是，会自动分配空间并执行<code>__init__</code>方法，<code>__init__</code>是对象的内置方法，专门用来定义一个类具有哪些属性的方法，在<code>__init__</code>方法内部使用<code>self.属性名= 初始值</code>就可以定义属性！</p>
</li>
<li><p>对<code>__init__</code>方法加上参数，就可以在<code>__init__</code>内部使用<code>self.属性 = 形参</code>接收外部传递的参数</p>
</li>
<li><p>在创建对象时，使用<code>类名(属性1， 属性2...)</code>的形式即可完成对象的构造</p>
</li>
</ol>
<h2 id="del-方法"><a href="#del-方法" class="headerlink" title="__del__方法"></a>__del__方法</h2><p><strong><code>__del__</code>方法就相当于C++中的析构函数！</strong></p>
<p>当使用<code>类名()</code>创建对象时，自动调用<code>__init__</code>方法，当对象从内存中销毁之前，会自动调用<code>__del__</code>方法</p>
<h3 id="应用场景"><a href="#应用场景" class="headerlink" title="应用场景"></a>应用场景</h3><ul>
<li><p><code>__init__</code>改造初始化方法，可以让创建对象更加灵活</p>
</li>
<li><p><code>__del__</code>如果希望在对象被销毁前做些事情，考虑使用<code>__del__</code>方法</p>
</li>
</ul>
<h3 id="生命周期"><a href="#生命周期" class="headerlink" title="生命周期"></a>生命周期</h3><p><code>__init__</code>————–&gt;<code>__del__</code></p>
<h2 id="str-方法"><a href="#str-方法" class="headerlink" title="__str__方法"></a>__str__方法</h2><p><strong>相当于Java的toString方法</strong></p>
<p>直接使用print打印对象获得的结果是该对象的所属类和在内存中的地址，如果希望自定义内容，<code>__str__</code>方法是不二之选！</p>
<h2 id="身份运算符"><a href="#身份运算符" class="headerlink" title="身份运算符"></a>身份运算符</h2><p><code>is</code>或<code>is not</code>，注意<code>is</code>与<code>==</code>的区别：</p>
<p><code>is</code>用来判断两个不舒服引用的对象是否是同一个，相当于Java的<code>==</code></p>
<p><code>==</code>用来判断引用变量的值是否相等，相当于Java的<code>equest</code>方法</p>
<h2 id="私有属性和私有方法"><a href="#私有属性和私有方法" class="headerlink" title="私有属性和私有方法"></a>私有属性和私有方法</h2><h3 id="定义方式"><a href="#定义方式" class="headerlink" title="定义方式"></a>定义方式</h3><p>在定义属性或者方法时，在属性名或者方法名前增加两个下划线，定义的就是私有属性或方法</p>
<h3 id="伪私有属性和私有方法"><a href="#伪私有属性和私有方法" class="headerlink" title="伪私有属性和私有方法"></a>伪私有属性和私有方法</h3><p>Python并没有真正意义上的私有</p>
<p>在给属性和方法命名时，实际是对名称做了一些特殊的处理，使的外界无法访问</p>
<p>处理方式：在名称前面加上<code>_类名</code>=&gt;<code>_类名__名称</code></p>
<h2 id="继承"><a href="#继承" class="headerlink" title="继承"></a>继承</h2><p>格式：<code>class 类名(父类名)</code></p>
<p>子类继承父类的所有属性和方法</p>
<h3 id="方法重写"><a href="#方法重写" class="headerlink" title="方法重写"></a>方法重写</h3><p>重写父类方法有两种情况</p>
<ol>
<li>覆盖父类中的方法</li>
<li>对父类中的方法进行扩展</li>
<li>重写之后只会调用子类中重写的方法，而不会调用父类中封装的方法</li>
</ol>
<h3 id="关于super"><a href="#关于super" class="headerlink" title="关于super"></a>关于super</h3><ul>
<li>在python中super是一个特殊的类</li>
<li><code>super()</code>就是使用<code>spuer</code>类创建出来的对象</li>
<li>最常使用的场景就是在重写父类方法时，调用在父类中封装的方法实现</li>
</ul>
<blockquote>
<p>调用父类方法的另一种方式，在Python2.x时，如果需要调用父类的方法，还可以使用<code>父类名.方法（self）</code>，这种方式目前在Python3.x还支持，但是不推荐使用</p>
</blockquote>
<p><strong>在开发中<code>父类名</code>和<code>super()</code>两种方式不要混用，如果使用当前子类名调用方法会形成递归调用，出现死循环</strong></p>
<h2 id="父类的私有属性和私有方法"><a href="#父类的私有属性和私有方法" class="headerlink" title="父类的私有属性和私有方法"></a>父类的私有属性和私有方法</h2><ul>
<li>子类对象不能在自己的方法内部直接访问父类的私有属性或者私有方法</li>
<li>子类对象可以通过父类的公有方法简介访问到私有属性或者私有方法，例如<code>Java的get和set</code></li>
<li>私有属性、方法是对象的隐私，不对外公开，外界及其子类都不能访问</li>
</ul>
<h2 id="多继承"><a href="#多继承" class="headerlink" title="多继承"></a>多继承</h2><p>子类可以有多个父类，并且具有所有父类的属性和方法</p>
<p>格式<code>class 子类名(父类名1，父类名2... )</code></p>
<p>如果不同的父类中存在同名的方法，子类在调用父类中的方法时会不明确调用哪一个方法，所以开发时应该尽且避免这种容易产生混淆的情况!如果父类之间存在同名的属性或方法.应该尽量避免使用多继承！</p>
<h3 id="Python中的MRO-–-方法搜索顺序"><a href="#Python中的MRO-–-方法搜索顺序" class="headerlink" title="Python中的MRO – 方法搜索顺序"></a>Python中的MRO – 方法搜索顺序</h3><ul>
<li>Python中针对类提供了一个内置属性<code>__mor__</code>可以查看方法搜索顺序</li>
<li>MRO的全称是<code>method reslution order</code>，主要是用于在多继承的时候判断方法、属性的调用路径</li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">A</span>:</span></span><br><span class="line">    <span class="keyword">pass</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">B</span>:</span></span><br><span class="line">    <span class="keyword">pass</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">C</span><span class="params">(A, B)</span>:</span></span><br><span class="line">    <span class="keyword">pass</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">print(C.mro())</span><br></pre></td></tr></table></figure>

<p><code>输出：[&lt;class &#39;__main__.C&#39;&gt;, &lt;class &#39;__main__.A&#39;&gt;, &lt;class &#39;__main__.B&#39;&gt;, &lt;class &#39;object&#39;&gt;]</code></p>
<ul>
<li>在搜索方法时，时按照<code>__mro__</code>的输出结果从左至右的顺序查找的</li>
<li>如果在当前类中找到方法，就直接执行，不再搜索</li>
<li>如果没有找到，就查找下一个类中是否有对应的方法，如果找到，就直接执行，不再搜索</li>
<li>如果找到最后一个类买还是没有找到方法，程序报错</li>
</ul>
<h3 id="新式类与旧式-经典-类"><a href="#新式类与旧式-经典-类" class="headerlink" title="新式类与旧式(经典)类"></a>新式类与旧式(经典)类</h3><p><code>object</code>是python为所有对象提供的基类，提供有一些内置的属性和方法，使用<code>dir</code>函数查看</p>
<ul>
<li><p>新式类：以object作为基类的类，推荐使用</p>
</li>
<li><p>经典类：不以object作为基类的类，不推荐使用</p>
</li>
<li><p>Python3.x中所有的类都是新式类</p>
</li>
<li><p>Python2.x中如果没有指定父类，则不会以object作为父类</p>
</li>
<li><p>新式类和旧式类在多继承时会影响到方法的搜索顺序，建议统一使用新式类</p>
</li>
</ul>
<h2 id="多态"><a href="#多态" class="headerlink" title="多态"></a>多态</h2><p>不同的子类对象，调用的相同的父类方法，产生不同的执行结果</p>
<ul>
<li><p>增加代码的灵活度</p>
</li>
<li><p>以继承和重写父类方法为前提</p>
</li>
<li><p>是调用方法的技巧，不会影响到类的内部设计</p>
</li>
</ul>
<p>每一个对象都有自己的独立的内存空间，保存各自不同的属性</p>
<p>每个对象的方法在内存中只有一份，在调用方法时，需要把对象的引用传递到方法内部</p>
<h2 id="Python中一切皆对象"><a href="#Python中一切皆对象" class="headerlink" title="Python中一切皆对象"></a>Python中一切皆对象</h2><p><code>class  AAA:</code>定义的类属于类对象</p>
<p><code>obj = AAA()</code>属于实例对象</p>
<ul>
<li><p>在程序运行时，类同样会被加载到内存，在Python中类是一个特殊的对象</p>
</li>
<li><p>在程序运行时，类对象在内存中只有一份</p>
</li>
<li><p>除了封装实例的属性和方法外，类对象还可以拥有自己的属性和方法</p>
<ul>
<li>类属性</li>
<li>类方法</li>
</ul>
</li>
<li><p>通过<code>类名.</code>的方式可以访问类的属性或者调用类的方法</p>
</li>
</ul>
<h2 id="类属性和实例属性"><a href="#类属性和实例属性" class="headerlink" title="类属性和实例属性"></a>类属性和实例属性</h2><ul>
<li>类似于Java的static成员变量</li>
<li>类属性就是给类对象中定义的属性</li>
<li>通常用来记录与这个类相关的特征</li>
<li>类属性不会用于记录对象的特征</li>
</ul>
<p>示例需求</p>
<ul>
<li>定义一个工具类</li>
<li>每件工具都有自己的name</li>
<li>需求 – 直到使用这个类，创建了多少个工具对象？</li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Tool</span>:</span></span><br><span class="line">    <span class="comment"># 定义类属性</span></span><br><span class="line">    count = <span class="number">0</span></span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">__init__</span><span class="params">(self, name)</span>:</span></span><br><span class="line">        self.name = name</span><br><span class="line">        <span class="comment"># 让类属性的值加一</span></span><br><span class="line">        Tool.count += <span class="number">1</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">t1 = Tool(<span class="string">"AAA"</span>)</span><br><span class="line">t2 = Tool(<span class="string">"BBB"</span>)</span><br><span class="line">t3 = Tool(<span class="string">"CCC"</span>)</span><br><span class="line">t4 = Tool(<span class="string">"DDD"</span>)</span><br><span class="line"></span><br><span class="line">print(t1.count)     <span class="comment"># 总创建了4个对象</span></span><br></pre></td></tr></table></figure>

<h3 id="属性的获取机制"><a href="#属性的获取机制" class="headerlink" title="属性的获取机制"></a>属性的获取机制</h3><p>在Python中属性的获取存在一个向上查找机制，首先在对象内部查找对象属性，没有的话就会向上查找类属性</p>
<p>所以访问类属性有两种方式：</p>
<ul>
<li><p><code>类名.类属性</code></p>
</li>
<li><p><code>对象.类属性</code>（不推荐使用）</p>
</li>
</ul>
<p>注意如果使用<code>对象.类属性 = 值</code>赋值语句，只会对给对象添加一个属性，而不会影响到类属性的值</p>
<h2 id="类方法与静态方法"><a href="#类方法与静态方法" class="headerlink" title="类方法与静态方法"></a>类方法与静态方法</h2><p><strong>类方法与类属性一致，类方法是针对这个类而定义的方法，而不是针对对象定义的方法</strong></p>
<h3 id="类方法"><a href="#类方法" class="headerlink" title="类方法"></a>类方法</h3><p>语法如下：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> 类名:</span></span><br><span class="line"><span class="meta">    @classmethod</span></span><br><span class="line">    <span class="function"><span class="keyword">def</span> 类方法名<span class="params">(cls)</span>:</span></span><br><span class="line">        <span class="keyword">pass</span></span><br></pre></td></tr></table></figure>

<ul>
<li><p>类方法需要使用<code>@classmethod</code>来标识，告诉解释器这是一个类方法</p>
</li>
<li><p>类方法的第一个参数应该是<code>cls</code></p>
<ul>
<li>由哪一个类调用的方法，方法内的<code>cls</code>就是那一个类引用</li>
<li>这个参数与实例方法的<code>self</code>比较相似</li>
<li>使用其他名称也可以，不一定非的是cls，不过习惯使用<code>cls</code></li>
</ul>
</li>
<li><p>通过<code>类名.</code>的方式调用类方法时不需要传递<code>cls</code>参数</p>
</li>
<li><p>在方法内部</p>
<ul>
<li><p>可以通过<code>cls.</code>访问类属性</p>
</li>
<li><p>可以通过<code>cls.</code>调用类方法</p>
</li>
</ul>
</li>
</ul>
<h3 id="静态方法"><a href="#静态方法" class="headerlink" title="静态方法"></a>静态方法</h3><p>如果一个方法需要访问实例属性，那么封装为实例方法，如果需要访问类属性，使用<code>类名.</code>访问类属性</p>
<p>如果一个方法需要访问类属性，那么封装为类方法</p>
<p>如果一个方法既不需要访问实例属性，也不需要访问类属性，那么封装为静态方法</p>
<p>语法如下：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@staticmethod</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> 静态方法名称<span class="params">()</span>:</span></span><br><span class="line">	<span class="keyword">pass</span></span><br></pre></td></tr></table></figure>

<ul>
<li>静态方法需要用修饰器<code>@staticmethod</code>来标识，告诉解释器这是静态方法</li>
<li>通过<code>类名.</code>调用静态方法</li>
</ul>
<h2 id="单例模式"><a href="#单例模式" class="headerlink" title="单例模式"></a>单例模式</h2><p>内存中只有一个该类的实例</p>
<ol>
<li>定义一个类属性，初始值为<code>None</code>，用来记录单例对象的引用</li>
<li>重写<code>__new__</code>方法</li>
<li>如果类属性<code>is None</code>，调用父类方法并分配空间，并在类属性中记录结果</li>
<li>返回类属性中记录的结果</li>
</ol>
<h3 id="new-方法"><a href="#new-方法" class="headerlink" title="__new__方法"></a>__new__方法</h3><ul>
<li><p>使用<strong>类名()</strong>创建对象时，python的解释器会自动调用<code>__new__</code>方法为对象分配空间</p>
</li>
<li><p><code>__new__</code>是一个由<code>object</code>基类提供的内置静态方法，作用</p>
<ul>
<li>在内存中为对象分配空间</li>
<li>返回对象的引用</li>
</ul>
</li>
<li><p>python的解释器获取引用后，将引用作为第一个参数，传递给<code>__init__</code>方法</p>
<blockquote>
<p>重写<code>__new__</code>方法的代码非常固定！</p>
</blockquote>
</li>
</ul>
<ul>
<li><p>重写<code>__new__</code>方法一定要<code>return super().__new__(cls)</code></p>
</li>
<li><p>否则Python的解释器得不到分配空间的对象引用，就不会调用对象的初始化方法</p>
</li>
<li><p>注意：<code>__new__</code>是一个静态方法，在调用时需要主动传递<code>cls</code>参数</p>
</li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">MusicPlayer</span><span class="params">(object)</span>:</span></span><br><span class="line">    <span class="comment"># 记录第一个被创建对象的引用</span></span><br><span class="line">    instance = <span class="literal">None</span></span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">__new__</span><span class="params">(cls, *args, **kwargs)</span>:</span></span><br><span class="line">        <span class="comment"># 判断类属性是否为空对象</span></span><br><span class="line">        <span class="keyword">if</span> cls.instance <span class="keyword">is</span> <span class="literal">None</span>:</span><br><span class="line">            <span class="comment"># 调用父类方法，为第一个对象分配空间</span></span><br><span class="line">            cls.instance = super().__new__(cls)</span><br><span class="line">        <span class="comment"># 返回类属性保存的对象引用</span></span><br><span class="line">        <span class="keyword">return</span> cls.instance</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">m1 = MusicPlayer()</span><br><span class="line">m2 = MusicPlayer()</span><br><span class="line">print(m1)</span><br><span class="line">print(m2)</span><br></pre></td></tr></table></figure>

<p>&lt; __main__.MusicPlayer object at 0x000001F9A381F8D0&gt;<br>&lt;__main__.MusicPlayer object at 0x000001F9A381F8D0&gt;</p>
<p>上面的做法虽然可以完成单例，但是初始化方法还是执行了两次,稍加修改让init方法也执行一次</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">MusicPlayer</span><span class="params">(object)</span>:</span></span><br><span class="line">    <span class="comment"># 记录第一个被创建对象的引用</span></span><br><span class="line">    instance = <span class="literal">None</span></span><br><span class="line"></span><br><span class="line">    <span class="comment"># 初始化方法调用标记</span></span><br><span class="line">    init_flag = <span class="literal">False</span></span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">__new__</span><span class="params">(cls, *args, **kwargs)</span>:</span></span><br><span class="line">        <span class="comment"># 判断类属性是否为空对象</span></span><br><span class="line">        <span class="keyword">if</span> cls.instance <span class="keyword">is</span> <span class="literal">None</span>:</span><br><span class="line">            <span class="comment"># 调用父类方法，为第一个对象分配空间</span></span><br><span class="line">            cls.instance = super().__new__(cls)</span><br><span class="line">        <span class="comment"># 返回类属性保存的对象引用</span></span><br><span class="line">        <span class="keyword">return</span> cls.instance</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">__init__</span><span class="params">(self)</span>:</span></span><br><span class="line">        <span class="keyword">if</span> MusicPlayer.init_flag <span class="keyword">is</span> <span class="literal">False</span>:</span><br><span class="line">            super()</span><br><span class="line">            MusicPlayer.init_flag = <span class="literal">True</span></span><br><span class="line">            print(<span class="string">"init()..."</span>)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">m1 = MusicPlayer()</span><br><span class="line">m2 = MusicPlayer()</span><br><span class="line">print(m1)</span><br><span class="line">print(m2)</span><br></pre></td></tr></table></figure>

<h2 id="异常"><a href="#异常" class="headerlink" title="异常"></a>异常</h2><h3 id="捕获异常"><a href="#捕获异常" class="headerlink" title="捕获异常"></a>捕获异常</h3><ul>
<li>简单基本格式</li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">try</span>:</span><br><span class="line">	尝试执行的代码</span><br><span class="line"><span class="keyword">except</span>：</span><br><span class="line">	出现错误的处理</span><br></pre></td></tr></table></figure>

<ul>
<li>错误类型捕获，针对不同类型的异常，做出不同的处理</li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">try</span>:</span><br><span class="line">	<span class="keyword">pass</span></span><br><span class="line">expect 错误类型<span class="number">1</span>：</span><br><span class="line">	<span class="comment"># 针对错误类型1的处理</span></span><br><span class="line">	<span class="keyword">pass</span></span><br><span class="line">expect 错误类型<span class="number">2</span>：</span><br><span class="line">	<span class="comment"># 针对错误类型2的处理</span></span><br><span class="line">	<span class="keyword">pass</span></span><br><span class="line">expect Exception <span class="keyword">as</span> result:</span><br><span class="line">	print(<span class="string">"未知错误%s"</span> % result)</span><br></pre></td></tr></table></figure>

<h3 id="捕获异常的完整语法"><a href="#捕获异常的完整语法" class="headerlink" title="捕获异常的完整语法"></a>捕获异常的完整语法</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">try</span>:</span><br><span class="line">    <span class="comment"># 尝试执行的代码</span></span><br><span class="line">	<span class="keyword">pass</span></span><br><span class="line">expect 错误类型<span class="number">1</span>：</span><br><span class="line">	<span class="comment"># 针对错误类型1的处理</span></span><br><span class="line">	<span class="keyword">pass</span></span><br><span class="line">expect 错误类型<span class="number">2</span>：</span><br><span class="line">	<span class="comment"># 针对错误类型2的处理</span></span><br><span class="line">    <span class="keyword">pass</span></span><br><span class="line"><span class="keyword">except</span>(错误类型<span class="number">3</span>，错误类型<span class="number">4</span>):</span><br><span class="line">    <span class="keyword">pass</span></span><br><span class="line"><span class="keyword">except</span> Exception <span class="keyword">as</span> result:</span><br><span class="line">    <span class="comment"># 打印错误信息</span></span><br><span class="line">    print(result)</span><br><span class="line"><span class="keyword">else</span>:</span><br><span class="line">    <span class="comment"># 没有异常才会执行的代码</span></span><br><span class="line">    <span class="keyword">pass</span></span><br><span class="line"><span class="keyword">finally</span>:</span><br><span class="line">    <span class="comment"># 必须要执行的代码</span></span><br></pre></td></tr></table></figure>

<h3 id="异常的传递"><a href="#异常的传递" class="headerlink" title="异常的传递"></a>异常的传递</h3><p>如果在某个函数中发生异常却未处理，异常会传递给调用方，会层层向上传递直到有遇到处理异常的代码为止，如果都没有处理此异常将会传递至主程序！</p>
<h3 id="手动抛出异常"><a href="#手动抛出异常" class="headerlink" title="手动抛出异常"></a>手动抛出异常</h3><p>Python提供了一个<code>Exception</code>异常类，如果希望抛出异常先创建一个<code>Exception</code>的对象，然后使用<code>raise</code>关键字抛出异常对象即可！</p>
<h2 id="模块"><a href="#模块" class="headerlink" title="模块"></a>模块</h2><ul>
<li><code>import 模块名1，模块名2</code> 不推荐使用，每个导入应该独占一行</li>
<li><code>import 模块名 as 名称简写</code> 给模块起别名</li>
<li><code>from 模块名 import 工具名</code> 从某一个模块中导入部分工具，这种方式导入的话不需要通过<code>模块名.</code>的方式来访问的，导入之后可以直接使用模块提供的工具—–全局变量、函数、类</li>
</ul>
<blockquote>
<p>注意如果两个模块存在同名的函数，那么后导入的模块的函数会覆盖先导入的函数!</p>
</blockquote>
<ul>
<li><code>from 模块名 import *</code>  这样可以一次性把模块中的所有工具全部导入，不推荐使用</li>
</ul>
<h4 id="模块的搜索顺序"><a href="#模块的搜索顺序" class="headerlink" title="模块的搜索顺序"></a>模块的搜索顺序</h4><p>搜索当前目录指定模块名的文件，如果有就直接导入，没有的话再搜索系统目录</p>
<blockquote>
<p>注意：在开发时给文件起名不要和系统模块文件重名!</p>
</blockquote>
<p>Python中每一个模块都有一个内置属性<code>__file__</code>可以查看模块的完整路径</p>
<h3 id="原则–每一个文件都应该是可以被导入的"><a href="#原则–每一个文件都应该是可以被导入的" class="headerlink" title="原则–每一个文件都应该是可以被导入的"></a>原则–每一个文件都应该是可以被导入的</h3><p>在导入文件时，文件中所有没有任何缩进的代码都会被执行一遍</p>
<p>应用场景：模块的开发者通常会在模块下方增加一些测试代码，仅仅在模块内补使用，不会被到导入到其他文件中</p>
<h4 id="name-属性"><a href="#name-属性" class="headerlink" title="__name__属性"></a><code>__name__属性</code></h4><ul>
<li><p><code>__name__</code>属性可以做到，测试模块的代码只在测试情况下运行，而被导入时不会被执行</p>
</li>
<li><p><code>__name__</code>时python的一个内置属性，记录着一个字符串</p>
</li>
<li><p>如果是被其他文件导入的，<code>__name__</code>就是模块名</p>
</li>
<li><p>如果是当前执行的程序，<code>__name__</code>是<code>__main__</code></p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">if</span> __name__ == <span class="string">"__main__"</span>:</span><br><span class="line">	<span class="comment"># 测试代码</span></span><br><span class="line">	<span class="keyword">pass</span></span><br></pre></td></tr></table></figure>



</li>
</ul>
<h2 id="包（Package"><a href="#包（Package" class="headerlink" title="包（Package)"></a>包（Package)</h2><p>包下必须有一个特殊的文件<code>__init__.py</code>，使用<code>import 包名</code>可以导入包下所有的模块</p>
<h3 id="init-py"><a href="#init-py" class="headerlink" title="__init__.py"></a>__init__.py</h3><ul>
<li>要在外界使用包中的模块，需要在<code>__init__.py</code>中指定对外提供的模块列表</li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 从当前目录导入模块列表</span></span><br><span class="line"><span class="keyword">from</span> . <span class="keyword">import</span> 模块名</span><br></pre></td></tr></table></figure>

<h3 id="发布压缩包的制作"><a href="#发布压缩包的制作" class="headerlink" title="发布压缩包的制作"></a>发布压缩包的制作</h3><ul>
<li>创建<code>setup.py</code>文件，关于字典参数的详细信息，<a href="http://docs.python.org/2/distutils/apiref.html" target="_blank" rel="noopener">http://docs.python.org/2/distutils/apiref.html</a></li>
<li>构建模块 <code>python2 setup.py build</code></li>
<li>生成发布压缩包<code>puthon3 setup.py sdist</code></li>
</ul>
<h3 id="安装-卸载模块"><a href="#安装-卸载模块" class="headerlink" title="安装/卸载模块"></a>安装/卸载模块</h3><ul>
<li>先解压<code>tar -zxvf 文件名</code></li>
<li>再安装<code>sudo python3 setup.py install</code></li>
<li><code>cd /usr/local/lib/python3.5/dist-packages</code>再<code>sudo rm -f XXX</code>即可卸载</li>
</ul>
<h2 id="pip安装第三方模块"><a href="#pip安装第三方模块" class="headerlink" title="pip安装第三方模块"></a>pip安装第三方模块</h2><p>pip是一个通用的python包管理工具，提供了对Python包的查找、下载、安装、卸载等功能</p>
<p>例如安装pygame这个模块<code>sudo pip install pygame</code>但是这样只能将模块安装到Python2.x环境，如果需要安装到Python3.x的环境，需要使用<code>sudo pip3 install pygame</code></p>
<h2 id="文件"><a href="#文件" class="headerlink" title="文件"></a>文件</h2><p>在Python中操作文件需要记住1个函数3个方法</p>
<table>
<thead>
<tr>
<th>函数/方法</th>
<th>说明</th>
</tr>
</thead>
<tbody><tr>
<td>open(函数)</td>
<td>打开文件，并且返回文件操作对象</td>
</tr>
<tr>
<td>read</td>
<td>将文件读取到内存</td>
</tr>
<tr>
<td>write</td>
<td>将指定内容写入文件</td>
</tr>
<tr>
<td>close</td>
<td>关闭文件</td>
</tr>
</tbody></table>
<p>open函数默认以只读方式打开文件，并且返回文件对象</p>
<table>
<thead>
<tr>
<th>访问方式</th>
<th>说明</th>
</tr>
</thead>
<tbody><tr>
<td>r</td>
<td>以只读方式打开，这是默认模式，如果文件不存在则抛出异常</td>
</tr>
<tr>
<td>w</td>
<td>以只写方式打开文件，如果文件存在会被覆盖，如果文件不存在则创建新文件</td>
</tr>
<tr>
<td>a</td>
<td>r+以追加方式打开文件，如果文件存在，文件指针将会放到末尾，若不存在创建新文件</td>
</tr>
<tr>
<td>r+</td>
<td>以读写方式打开文件，文件的指针将会放在文件的开头，如果文件不存在，抛出异常</td>
</tr>
<tr>
<td>w+</td>
<td>以读写方式打开文件，如果文件存在，文件指针将会放在文件的开头，如果不存在创建新文件</td>
</tr>
<tr>
<td>a+</td>
<td>以读写方式打开文件，如果文件已经存在，文件指针将会放在文件的结尾，若不存在就创建新文件写入</td>
</tr>
</tbody></table>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">file = open(<span class="string">"a.txt"</span>, <span class="string">"r"</span>)</span><br><span class="line"><span class="keyword">while</span> <span class="literal">True</span>:</span><br><span class="line">    text = file.readline()</span><br><span class="line"></span><br><span class="line">    <span class="keyword">if</span> <span class="keyword">not</span> text:</span><br><span class="line">        <span class="keyword">break</span></span><br><span class="line"></span><br><span class="line">    print(text, end=<span class="string">""</span>)</span><br></pre></td></tr></table></figure>

<h2 id="文件-目录的常用管理操作"><a href="#文件-目录的常用管理操作" class="headerlink" title="文件/目录的常用管理操作"></a>文件/目录的常用管理操作</h2><p>创建、重命名、删除、更改路径、查看目录内容…</p>
<p>Python 中如果希望通过程序实现上述功能需要导入<code>os</code>模块</p>
<h3 id="文件操作"><a href="#文件操作" class="headerlink" title="文件操作"></a>文件操作</h3><table>
<thead>
<tr>
<th>方法名</th>
<th>说明</th>
<th>示例</th>
</tr>
</thead>
<tbody><tr>
<td>rename</td>
<td>重命名文件</td>
<td>os.rename(源文件名，目标文件名)</td>
</tr>
<tr>
<td>remove</td>
<td>删除文件</td>
<td>os.remove(文件名)</td>
</tr>
</tbody></table>
<h3 id="目录操作"><a href="#目录操作" class="headerlink" title="目录操作"></a>目录操作</h3><table>
<thead>
<tr>
<th>方法名</th>
<th>说明</th>
<th>示例</th>
</tr>
</thead>
<tbody><tr>
<td>listdir</td>
<td>目录列表</td>
<td>os.listdir(目录名)</td>
</tr>
<tr>
<td>mkdir</td>
<td>创建目录</td>
<td>os.mkdir(目录名)</td>
</tr>
<tr>
<td>rmdir</td>
<td>删除目录</td>
<td>os.rmdir(目录名)</td>
</tr>
<tr>
<td>getcwd</td>
<td>获取当前目录</td>
<td>os.getcwd()</td>
</tr>
<tr>
<td>chdir</td>
<td>修改工作目录</td>
<td>os.chdir(目标目录)</td>
</tr>
<tr>
<td>path.isdir</td>
<td>判断是否是文件</td>
<td>os.psth.isdir(文件路径)</td>
</tr>
</tbody></table>
<blockquote>
<p>注意：文件或者目录都支持相对路径和绝对路径</p>
</blockquote>
<h3 id="文本文件的编码格式"><a href="#文本文件的编码格式" class="headerlink" title="文本文件的编码格式"></a>文本文件的编码格式</h3><ul>
<li>文本文件存储的内容是基于字符编码的文件，常见的编码有<code>ASCII</code>编码，<code>UNICODE</code>编码</li>
<li>Python2.x默认使用<code>ASCII</code>编码</li>
<li>Python3.x默认使用<code>UTF-8</code>编码</li>
</ul>
<p>在Python2.x文件的第一行增加以下注释，解释器会以<code>UTF-8</code>编码来处理文件，这也是官方推荐的方式</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># *-* coding:utf8 *-*</span></span><br></pre></td></tr></table></figure>

<p>Python2.x中使用中文字符串需要在字符串前面加小写u，例如<code>str = u&quot;中文&quot;</code>即可！</p>
<h2 id="eval函数"><a href="#eval函数" class="headerlink" title="eval函数"></a>eval函数</h2><ul>
<li>基本的数学计算，与JavaScript中的eval函数一致</li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">In [<span class="number">1</span>]: eval(<span class="string">"5-3"</span>)</span><br><span class="line">Out[<span class="number">1</span>]: <span class="number">2</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">2</span>]: eval(<span class="string">"'*' * 10"</span>)</span><br><span class="line">Out[<span class="number">2</span>]: <span class="string">'**********'</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">3</span>]: type(eval(<span class="string">"[1, 2, 3, 4, 5]"</span>))</span><br><span class="line">Out[<span class="number">3</span>]: list</span><br><span class="line"></span><br><span class="line">In [<span class="number">4</span>]: type(eval(<span class="string">"&#123;'name':'Tim', 'age':20&#125;"</span>))</span><br><span class="line">Out[<span class="number">4</span>]: dict</span><br></pre></td></tr></table></figure>

<blockquote>
<p><strong>注意在开发时不要使用eval函数转换input的结果！</strong></p>
</blockquote>
<p>一旦用户输入<code>__import__(&#39;os&#39;).system(&#39;终端命令&#39;)</code>这样的是非常可怕的！</p>
<h1 id="、is"><a href="#、is" class="headerlink" title="==、is"></a>==、is</h1><ul>
<li><code>is</code>是比较两个引用是否指向了同一个对象，即比较地址是否相同</li>
<li><code>==</code>是比较两个对象的值是否相等</li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">In [<span class="number">1</span>]: a = <span class="number">10</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">2</span>]: b = <span class="number">10</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">3</span>]: a == b</span><br><span class="line">Out[<span class="number">3</span>]: <span class="literal">True</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">4</span>]: a <span class="keyword">is</span> b</span><br><span class="line">Out[<span class="number">4</span>]: <span class="literal">True</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">5</span>]: a = <span class="number">257</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">6</span>]: b = <span class="number">257</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">7</span>]: a == b</span><br><span class="line">Out[<span class="number">7</span>]: <span class="literal">True</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">8</span>]: a <span class="keyword">is</span> b</span><br><span class="line">Out[<span class="number">8</span>]: <span class="literal">False</span></span><br></pre></td></tr></table></figure>

<h1 id="深拷贝与浅拷贝"><a href="#深拷贝与浅拷贝" class="headerlink" title="深拷贝与浅拷贝"></a>深拷贝与浅拷贝</h1><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">In [<span class="number">1</span>]: a = [<span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>]</span><br><span class="line"></span><br><span class="line">In [<span class="number">2</span>]: b = a</span><br><span class="line"></span><br><span class="line">In [<span class="number">3</span>]: id(a)</span><br><span class="line">Out[<span class="number">3</span>]: <span class="number">3143865105928</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">4</span>]: id(b)</span><br><span class="line">Out[<span class="number">4</span>]: <span class="number">3143865105928</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">5</span>]: <span class="keyword">import</span> copy <span class="keyword">as</span> cp</span><br><span class="line"></span><br><span class="line">In [<span class="number">6</span>]: c = cp.deepcopy(a)</span><br><span class="line"></span><br><span class="line">In [<span class="number">7</span>]: id(a)</span><br><span class="line">Out[<span class="number">7</span>]: <span class="number">3143865105928</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">8</span>]: id(c)</span><br><span class="line">Out[<span class="number">8</span>]: <span class="number">3143864558088</span></span><br></pre></td></tr></table></figure>

<h2 id="深拷贝是真的深！"><a href="#深拷贝是真的深！" class="headerlink" title="深拷贝是真的深！"></a>深拷贝是真的深！</h2><p><img src="https://img.zouchanglin.cn/blog/20200822/3rIU5I3LPUyp.png" alt="mark"></p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line">In [<span class="number">1</span>]: a = [<span class="number">11</span>, <span class="number">22</span>, <span class="number">33</span>]</span><br><span class="line"></span><br><span class="line">In [<span class="number">2</span>]: b = [<span class="number">44</span>, <span class="number">55</span>, <span class="number">66</span>]</span><br><span class="line"></span><br><span class="line">In [<span class="number">3</span>]: c = [a, b]</span><br><span class="line"></span><br><span class="line">In [<span class="number">4</span>]: d = c</span><br><span class="line"></span><br><span class="line">In [<span class="number">5</span>]: id(c)</span><br><span class="line">Out[<span class="number">5</span>]: <span class="number">2236861508936</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">6</span>]: id(d)</span><br><span class="line">Out[<span class="number">6</span>]: <span class="number">2236861508936</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">7</span>]: <span class="keyword">import</span> copy <span class="keyword">as</span> cp</span><br><span class="line"></span><br><span class="line">In [<span class="number">8</span>]: e = cp.deepcopy(c)</span><br><span class="line"></span><br><span class="line">In [<span class="number">9</span>]: id(e)</span><br><span class="line">Out[<span class="number">9</span>]: <span class="number">2236861766984</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">10</span>]: a.append(<span class="number">44</span>)</span><br><span class="line"></span><br><span class="line">In [<span class="number">11</span>]: e[<span class="number">0</span>]</span><br><span class="line">Out[<span class="number">11</span>]: [<span class="number">11</span>, <span class="number">22</span>, <span class="number">33</span>]</span><br></pre></td></tr></table></figure>

<p><img src="https://img.zouchanglin.cn/blog/20200822/5AM9Cuy2JEDa.png" alt="mark"></p>
<h2 id="拷贝的其他方式"><a href="#拷贝的其他方式" class="headerlink" title="拷贝的其他方式"></a>拷贝的其他方式</h2><h3 id="浅拷贝对不可变类型和可变类型的拷贝不同"><a href="#浅拷贝对不可变类型和可变类型的拷贝不同" class="headerlink" title="浅拷贝对不可变类型和可变类型的拷贝不同"></a>浅拷贝对不可变类型和可变类型的拷贝不同</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line">In [<span class="number">1</span>]: a = [<span class="number">11</span>, <span class="number">22</span>, <span class="number">33</span>]</span><br><span class="line"></span><br><span class="line">In [<span class="number">2</span>]: <span class="keyword">import</span> copy <span class="keyword">as</span> cp</span><br><span class="line"></span><br><span class="line">In [<span class="number">3</span>]: b = cp.copy(a)</span><br><span class="line"></span><br><span class="line">In [<span class="number">4</span>]: id(a)</span><br><span class="line">Out[<span class="number">4</span>]: <span class="number">2909126778056</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">5</span>]: id(b)</span><br><span class="line">Out[<span class="number">5</span>]: <span class="number">2909126747464</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">6</span>]: a.append(<span class="number">44</span>)</span><br><span class="line"></span><br><span class="line">In [<span class="number">7</span>]: a</span><br><span class="line">Out[<span class="number">7</span>]: [<span class="number">11</span>, <span class="number">22</span>, <span class="number">33</span>, <span class="number">44</span>]</span><br><span class="line"></span><br><span class="line">In [<span class="number">8</span>]: b</span><br><span class="line">Out[<span class="number">8</span>]: [<span class="number">11</span>, <span class="number">22</span>, <span class="number">33</span>]</span><br><span class="line"></span><br><span class="line">In [<span class="number">9</span>]: a = (<span class="number">11</span>, <span class="number">22</span>, <span class="number">33</span>)</span><br><span class="line"></span><br><span class="line">In [<span class="number">10</span>]: b = cp.copy(a)</span><br><span class="line"></span><br><span class="line">In [<span class="number">11</span>]: id(a)</span><br><span class="line">Out[<span class="number">11</span>]: <span class="number">2909126674544</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">12</span>]: id(b)</span><br><span class="line">Out[<span class="number">12</span>]: <span class="number">2909126674544</span></span><br></pre></td></tr></table></figure>

<h3 id="分片表达式可以构造一个序列"><a href="#分片表达式可以构造一个序列" class="headerlink" title="分片表达式可以构造一个序列"></a>分片表达式可以构造一个序列</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">a = <span class="string">"abc"</span></span><br><span class="line">b = a[:]</span><br></pre></td></tr></table></figure>

<h3 id="字典的copy方法可以拷贝一个字典"><a href="#字典的copy方法可以拷贝一个字典" class="headerlink" title="字典的copy方法可以拷贝一个字典"></a>字典的copy方法可以拷贝一个字典</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">In [<span class="number">13</span>]: d = dict(name=<span class="string">"Tim"</span>, age=<span class="number">10</span>)</span><br><span class="line"></span><br><span class="line">In [<span class="number">14</span>]: co = d.copy()</span><br><span class="line"></span><br><span class="line">In [<span class="number">15</span>]: id(d)</span><br><span class="line">Out[<span class="number">15</span>]: <span class="number">2909126284992</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">16</span>]: id(co)</span><br><span class="line">Out[<span class="number">16</span>]: <span class="number">2909126780176</span></span><br></pre></td></tr></table></figure>

<h3 id="有些内置函数可以生成拷贝"><a href="#有些内置函数可以生成拷贝" class="headerlink" title="有些内置函数可以生成拷贝"></a>有些内置函数可以生成拷贝</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">In [<span class="number">17</span>]: a = list(range(<span class="number">10</span>))</span><br><span class="line"></span><br><span class="line">In [<span class="number">18</span>]: b = list(a)</span><br><span class="line"></span><br><span class="line">In [<span class="number">19</span>]: b</span><br><span class="line">Out[<span class="number">19</span>]: [<span class="number">0</span>, <span class="number">1</span>, <span class="number">2</span>, <span class="number">3</span>, <span class="number">4</span>, <span class="number">5</span>, <span class="number">6</span>, <span class="number">7</span>, <span class="number">8</span>, <span class="number">9</span>]</span><br><span class="line"></span><br><span class="line">In [<span class="number">20</span>]: id(b)</span><br><span class="line">Out[<span class="number">20</span>]: <span class="number">2909126777096</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">21</span>]: id(a)</span><br><span class="line">Out[<span class="number">21</span>]: <span class="number">2909126776456</span></span><br></pre></td></tr></table></figure>

<h1 id="Python是动态语言"><a href="#Python是动态语言" class="headerlink" title="Python是动态语言"></a>Python是动态语言</h1><p>在计算机科学领域已被广泛应用。它是一类在运行时可以改变其结构的语语言：例如新的函数、对象、甚至代码可以被引进，已有的函数可以被删除或是其他结构上的变化。动态语言非常具有活力。例如JavaScript便是动态语言，除此之外如PHP 、 Ruby 、 Python 等也都属于动态语言，C 、 C++ 则不属于动态语言！</p>
<h2 id="运行的过程中给对象绑定-添加-属性"><a href="#运行的过程中给对象绑定-添加-属性" class="headerlink" title="运行的过程中给对象绑定(添加)属性"></a>运行的过程中给对象绑定(添加)属性</h2><p>这个比较简单，格式：<code>对象.属性 = 值</code>即可</p>
<h2 id="运行的过程中给类绑定-添加-属性"><a href="#运行的过程中给类绑定-添加-属性" class="headerlink" title="运行的过程中给类绑定(添加)属性"></a>运行的过程中给类绑定(添加)属性</h2><p>格式：<code>类名.属性 = 值</code>即可</p>
<h2 id="运行的过程中给类绑定-添加-方法"><a href="#运行的过程中给类绑定-添加-方法" class="headerlink" title="运行的过程中给类绑定(添加)方法"></a>运行的过程中给类绑定(添加)方法</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#-*- coding:utf-8 -*-</span></span><br><span class="line"><span class="keyword">import</span> types</span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Person</span><span class="params">(object)</span>:</span></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">__init__</span><span class="params">(self, newName, newAge)</span>:</span></span><br><span class="line">        self.name = newName</span><br><span class="line">        self.age = newAge</span><br><span class="line"></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">eat</span><span class="params">(self)</span>:</span></span><br><span class="line">        print(<span class="string">"----%s正在吃----"</span> % self.name)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">    </span><br><span class="line">p = Person(<span class="string">"老王"</span>, <span class="number">20</span>)</span><br><span class="line">p.eat()</span><br><span class="line"></span><br><span class="line"><span class="comment"># 给对象绑定方法</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">run</span><span class="params">(self)</span>:</span></span><br><span class="line">    print(<span class="string">"----%s正在跑----"</span> % self.name)</span><br><span class="line"></span><br><span class="line">p.run = types.MethodType(run, p)</span><br><span class="line">p.run()</span><br><span class="line"></span><br><span class="line"><span class="comment"># 给Person类绑定类方法</span></span><br><span class="line"><span class="meta">@classmethod</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">testClassMethod</span><span class="params">(cls)</span>:</span></span><br><span class="line">    print(<span class="string">"class method"</span>)</span><br><span class="line"></span><br><span class="line">Person.testclass = testClassMethod</span><br><span class="line">Person.testclass()</span><br><span class="line"></span><br><span class="line"><span class="comment"># 给Person类绑定静态方法</span></span><br><span class="line"><span class="meta">@staticmethod</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">testStaticMethod</span><span class="params">()</span>:</span></span><br><span class="line">    print(<span class="string">"static method"</span>)</span><br><span class="line"></span><br><span class="line">Person.teststatic = testStaticMethod</span><br><span class="line">Person.teststatic()</span><br></pre></td></tr></table></figure>

<h1 id="slots"><a href="#slots" class="headerlink" title="__slots__"></a>__slots__</h1><p>动态语言：可以在运行的过程中，修改代码</p>
<p>静态语言：编译器时期就已经确定代码，运行过程中不能修改</p>
<p>如果我们想要限制实例的属性怎么办？⽐如，只允许对Person实例添加name和age属性。<br>为了达到限制的⽬的，Python允许在定义class的时候，定义⼀个特殊的__slots__变量，来限制该class实例能添加的属性:</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">In [<span class="number">1</span>]: <span class="class"><span class="keyword">class</span> <span class="title">Person</span><span class="params">(object)</span>:</span></span><br><span class="line">   ...:     __slots__ = (<span class="string">"name"</span>, <span class="string">"age"</span>)</span><br><span class="line">   ...:</span><br><span class="line"></span><br><span class="line">In [<span class="number">2</span>]: p = Person()</span><br><span class="line"></span><br><span class="line">In [<span class="number">3</span>]: p.name = <span class="string">"XXX"</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">4</span>]: p.age = <span class="number">20</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">5</span>]: p.other = <span class="string">"---"</span></span><br><span class="line">---------------------------------------------------------------------------</span><br><span class="line">AttributeError                            Traceback (most recent call last)</span><br><span class="line">&lt;ipython-input<span class="number">-5</span>-dbbcced1d9ea&gt; <span class="keyword">in</span> &lt;module&gt;()</span><br><span class="line">----&gt; 1 p.other = "---"</span><br><span class="line"></span><br><span class="line">AttributeError: <span class="string">'Person'</span> object has no attribute <span class="string">'other'</span></span><br></pre></td></tr></table></figure>

<p><strong>注意</strong></p>
<ul>
<li>使⽤__slots__要注意，__slots__定义的属性仅对当前类实例起作⽤，对继承的⼦类是不起作⽤的</li>
</ul>
<h1 id="元类"><a href="#元类" class="headerlink" title="元类"></a>元类</h1><h2 id="类也是对象"><a href="#类也是对象" class="headerlink" title="类也是对象"></a>类也是对象</h2><p>在⼤多数编程语⾔中，类就是⼀组⽤来描述如何⽣成⼀个对象的代码段。在Python中这⼀点仍然成⽴！</p>
<p>Python中的类还远不⽌如此。类同样也是⼀种对象。是的，没错，就是对象。只要你使⽤关键字class，Python解释器在执⾏的时候就会创建⼀个对象！</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">In [<span class="number">1</span>]: <span class="class"><span class="keyword">class</span> <span class="title">Person</span>:</span></span><br><span class="line">   ...:     <span class="keyword">pass</span></span><br><span class="line">   ...:</span><br><span class="line">   ...:</span><br><span class="line"></span><br><span class="line">In [<span class="number">2</span>]: print(Person)</span><br><span class="line">&lt;<span class="class"><span class="keyword">class</span> '<span class="title">__main__</span>.<span class="title">Person</span>'&gt;</span></span><br></pre></td></tr></table></figure>

<p>将在内存中创建⼀个对象，名字就是ObjectCreator。这个对象（类对象ObjectCreator）拥有创建对象（实例对象）的能⼒。但是，它的本质仍然是⼀个对象，于是乎你可以对它做如下的操作：</p>
<ul>
<li>你可以将它赋值给⼀个变量</li>
<li>你可以拷⻉它</li>
<li>你可以为它增加属性</li>
<li>你可以将它作为函数参数进⾏传递</li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">&gt;&gt;&gt; </span><span class="keyword">print</span> ObjectCreator <span class="comment"># 你可以打印⼀个类，因为它其实也是⼀个对象</span></span><br><span class="line">&lt;<span class="class"><span class="keyword">class</span> '<span class="title">__main__</span>.<span class="title">ObjectCreator</span>'&gt;</span></span><br><span class="line"><span class="class">&gt;&gt;&gt; <span class="title">def</span> <span class="title">echo</span><span class="params">(o)</span>:</span></span><br><span class="line">… <span class="keyword">print</span> o</span><br><span class="line">…</span><br><span class="line"><span class="meta">&gt;&gt;&gt; </span>echo(ObjectCreator) <span class="comment"># 你可以将类做为参数传给函数</span></span><br><span class="line">&lt;<span class="class"><span class="keyword">class</span> '<span class="title">__main__</span>.<span class="title">ObjectCreator</span>'&gt;</span></span><br><span class="line"><span class="class">&gt;&gt;&gt; <span class="title">print</span> <span class="title">hasattr</span><span class="params">(ObjectCreator, <span class="string">'new_attribute'</span>)</span></span></span><br><span class="line"><span class="class"><span class="title">Fasle</span></span></span><br><span class="line">&gt;&gt;&gt; ObjectCreator.new_attribute = 'foo' # 你可以为类增加属性</span><br><span class="line"><span class="meta">&gt;&gt;&gt; </span><span class="keyword">print</span> hasattr(ObjectCreator, <span class="string">'new_attribute'</span>)</span><br><span class="line"><span class="literal">True</span></span><br><span class="line"><span class="meta">&gt;&gt;&gt; </span><span class="keyword">print</span> ObjectCreator.new_attribute</span><br><span class="line">foo</span><br><span class="line"><span class="meta">&gt;&gt;&gt; </span>ObjectCreatorMirror = ObjectCreator <span class="comment"># 你可以将类赋值给⼀个变量</span></span><br><span class="line"><span class="meta">&gt;&gt;&gt; </span><span class="keyword">print</span> ObjectCreatorMirror()</span><br><span class="line">&lt;__main__.ObjectCreator object at <span class="number">0x8997b4c</span>&gt;</span><br></pre></td></tr></table></figure>

<h2 id="动态地创建类"><a href="#动态地创建类" class="headerlink" title="动态地创建类"></a>动态地创建类</h2><p>因为类也是对象，你可以在运⾏时动态的创建它们，就像其他任何对象⼀样。⾸先，你可以在函数中创建类，使⽤class关键字即可！</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">In [<span class="number">1</span>]: <span class="function"><span class="keyword">def</span> <span class="title">chose_class</span><span class="params">(name)</span>:</span></span><br><span class="line">   ...:     <span class="keyword">if</span> name == <span class="string">"foo"</span>:</span><br><span class="line">   ...:         <span class="class"><span class="keyword">class</span> <span class="title">Foo</span><span class="params">(object)</span>:</span></span><br><span class="line">   ...:             <span class="keyword">pass</span></span><br><span class="line">   ...:         <span class="keyword">return</span> Foo <span class="comment"># 返回的是类，而不是类的实例</span></span><br><span class="line">   ...:     <span class="keyword">else</span>:</span><br><span class="line">   ...:         <span class="class"><span class="keyword">class</span> <span class="title">Bar</span><span class="params">(object)</span>:</span></span><br><span class="line">   ...:             <span class="keyword">pass</span></span><br><span class="line">   ...:         <span class="keyword">return</span> Bar</span><br><span class="line">   ...:</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">In [<span class="number">2</span>]: MyClass = chose_class(<span class="string">"foo"</span>)</span><br><span class="line"></span><br><span class="line">In [<span class="number">3</span>]: print(MyClass)</span><br><span class="line">&lt;<span class="class"><span class="keyword">class</span> '<span class="title">__main__</span>.<span class="title">chose_class</span>.&lt;<span class="title">locals</span>&gt;.<span class="title">Foo</span>'&gt;</span></span><br><span class="line"><span class="class"></span></span><br><span class="line"><span class="class"><span class="title">In</span> [4]:</span></span><br></pre></td></tr></table></figure>

<p>但这还不够动态，因为你仍然需要..编写整个类的代码。由于类也是对象，所以它们必须是通过什么东.来.成的才对。当你使.class关键字时，Python解释器自动创建这个对象。但就和Python中的大多数事情一样，Python仍然提供给你自动处理的方法。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">In [<span class="number">4</span>]: print(type(<span class="number">100</span>))</span><br><span class="line">&lt;<span class="class"><span class="keyword">class</span> '<span class="title">int</span>'&gt;</span></span><br><span class="line"><span class="class"></span></span><br><span class="line"><span class="class"><span class="title">In</span> [5]:</span> print(type(<span class="string">"Hello XPU"</span>))</span><br><span class="line">&lt;<span class="class"><span class="keyword">class</span> '<span class="title">str</span>'&gt;</span></span><br><span class="line"><span class="class"></span></span><br><span class="line"><span class="class"><span class="title">In</span> [6]:</span> print(type(MyClass))</span><br><span class="line">&lt;<span class="class"><span class="keyword">class</span> '<span class="title">type</span>'&gt;</span></span><br></pre></td></tr></table></figure>

<p>类对象的类型居然是<code>type</code>!!!</p>
<h2 id="使用type创建类"><a href="#使用type创建类" class="headerlink" title="使用type创建类"></a>使用type创建类</h2><p>type还有一种完全不同的功能，动态的创建类。<br>type可以接受一个类的描述作为参数，然后返回一个类（要知道，根据传入参数的不同，同一个函数拥有两种完全不同的用法是件很傻的事情，但这在Python中是为了保持向后兼容性）</p>
<h3 id="type创建类的格式"><a href="#type创建类的格式" class="headerlink" title="type创建类的格式"></a>type创建类的格式</h3><p><code>type(类名，由父类名称组成的元组（针对继承的情况，可以为空），包含属性的字典（名称和值）)</code></p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">In [<span class="number">7</span>]: <span class="class"><span class="keyword">class</span> <span class="title">Person</span>:</span></span><br><span class="line">   ...:     nums = <span class="number">0</span></span><br><span class="line">   ...:</span><br><span class="line"></span><br><span class="line">In [<span class="number">8</span>]: MyPerson = type(<span class="string">"MyPerson"</span>,(),&#123;<span class="string">"num"</span>:<span class="number">0</span>&#125;)</span><br><span class="line"></span><br><span class="line">In [<span class="number">9</span>]: p1 = Person()</span><br><span class="line"></span><br><span class="line">In [<span class="number">11</span>]: p1.nums</span><br><span class="line">Out[<span class="number">11</span>]: <span class="number">0</span></span><br><span class="line"></span><br><span class="line">In [<span class="number">12</span>]: p2 = MyPerson()</span><br><span class="line"></span><br><span class="line">In [<span class="number">13</span>]: p2.num</span><br><span class="line">Out[<span class="number">13</span>]: <span class="number">0</span></span><br></pre></td></tr></table></figure>

<h2 id="使用Type创建带属性的类"><a href="#使用Type创建带属性的类" class="headerlink" title="使用Type创建带属性的类"></a>使用Type创建带属性的类</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">In [<span class="number">1</span>]: Foo = type(<span class="string">"Foo"</span>, (),&#123;<span class="string">"bar"</span>:<span class="literal">True</span>&#125;)</span><br><span class="line"></span><br><span class="line">In [<span class="number">2</span>]: <span class="class"><span class="keyword">class</span> <span class="title">Foo2</span><span class="params">(object)</span>:</span></span><br><span class="line">   ...:     bar = <span class="literal">True</span></span><br><span class="line">   ...:</span><br></pre></td></tr></table></figure>

<p><strong>注意</strong></p>
<ul>
<li>type的第2个参数，元组中是⽗类的名字，⽽不是字符串</li>
<li>添加的属性是类属性，并不是实例属性</li>
</ul>
<h2 id="使⽤type创建带有⽅法的类"><a href="#使⽤type创建带有⽅法的类" class="headerlink" title="使⽤type创建带有⽅法的类"></a>使⽤type创建带有⽅法的类</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">In [<span class="number">1</span>]: Foo = type(<span class="string">"Foo"</span>, (),&#123;<span class="string">"bar"</span>:<span class="literal">True</span>&#125;)</span><br><span class="line"></span><br><span class="line">In [<span class="number">2</span>]: <span class="class"><span class="keyword">class</span> <span class="title">Foo2</span><span class="params">(object)</span>:</span></span><br><span class="line">   ...:     bar = <span class="literal">True</span></span><br><span class="line">   ...:</span><br><span class="line"></span><br><span class="line">In [<span class="number">3</span>]: <span class="function"><span class="keyword">def</span> <span class="title">my_fun</span><span class="params">(self)</span>:</span></span><br><span class="line">   ...:     print(self.bar)</span><br><span class="line">   ...:</span><br><span class="line"></span><br><span class="line">In [<span class="number">4</span>]: FooChild = type(<span class="string">'FoodChild'</span>,(Foo,), &#123;<span class="string">'echo_bar'</span>:my_fun&#125;)</span><br><span class="line"></span><br><span class="line">In [<span class="number">5</span>]: my_foo = FooChild()</span><br><span class="line"></span><br><span class="line">In [<span class="number">6</span>]: my_foo.echo_bar()</span><br><span class="line"><span class="literal">True</span></span><br></pre></td></tr></table></figure>

<h3 id="添加静态方法"><a href="#添加静态方法" class="headerlink" title="添加静态方法"></a>添加静态方法</h3><p>同上，需要在方法上面加注<code>@staticmethod</code>即可</p>
<h3 id="添加类方法"><a href="#添加类方法" class="headerlink" title="添加类方法"></a>添加类方法</h3><p>同上，需要在方法上面加注<code>@classmethod</code>即可</p>
<h2 id="元类的概念"><a href="#元类的概念" class="headerlink" title="元类的概念"></a>元类的概念</h2><p>在Python中，类也是对象，你可以动态的创建类。这就是当你使⽤关键字class时Python在幕后做的事情，⽽这就是通过元类来实现的！</p>
<p>元类就是⽤来创建类的“东⻄”。你创建类就是为了创建类的实例对象，不是吗？但是我们已经学习到了Python中的类也是对象。</p>
<p>函数type实际上是⼀个元类。type就是Python在背后⽤来创建所有类的元类。现在你想知道那为什么type会全部采⽤⼩写形式⽽不是Type呢？<br>好吧，我猜这是为了和str保持⼀致性，str是⽤来创建字符串对象的类，⽽int是⽤来创建整数对象的类。type就是创建类对象的类！可以通过检查__class__属性来看到这.点。Python中所有的东西都是对象。这包括整数、字符串、函数以及类。它们全部都是对象，而且它们都是从一个类创建而来，这个类就是<strong>type</strong>。</p>
<h2 id="metaclass-属性"><a href="#metaclass-属性" class="headerlink" title="__metaclass__属性"></a>__metaclass__属性</h2><p>定义⼀个类的时候为其添加<strong>metaclass</strong>属性</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Foo</span><span class="params">(object)</span>:</span></span><br><span class="line">	__metaclass__ = something...</span><br></pre></td></tr></table></figure>

<p>如果你这么做了，Python就会⽤元类来创建类Foo。⼩⼼点，这⾥⾯有些技巧。你⾸先写下class Foo(object)，但是类Foo还没有在内存中创建。Python会在类的定义中寻找<strong>metaclass</strong>属性，如果找到了，Python就会⽤它来创建类Foo，如果没有找到，就会⽤内建的type来创建这个类。把下⾯这段话反复读⼏次。当你写如下代码时:</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Foo</span><span class="params">(Bar)</span>:</span></span><br><span class="line">	<span class="keyword">pass</span></span><br></pre></td></tr></table></figure>

<p>Python做了如下的操作：</p>
<ol>
<li><p>Foo中有<code>__metaclass__</code>这个属性吗？如果是，Python会通过<code>__metaclass__</code>创建⼀个名字为Foo的类(对象)</p>
</li>
<li><p>如果Python没有找到<code>__metaclass__</code>，它会继续在Bar（⽗类）中寻找<code>__metaclass__</code>属性，并尝试做和前⾯同样的操作</p>
</li>
<li><p>如果Python在任何⽗类中都找不到<code>__metaclass__</code>，它就会在模块层次中去寻找<code>__metaclass__</code>，并尝试做同样的操作</p>
</li>
<li><p>如果还是找不到<code>__metaclass__</code>,Python就会⽤内置的type来创建这个类对象</p>
</li>
</ol>
<p>你可以在<code>__metaclass__</code>中放置些什么代码呢？答案就是：可以创建一个类的东西。那么什么可以用来创建一个类呢？type，或者任何使用到type或者子类化type的东西都可以！</p>
<h2 id="自定义元类"><a href="#自定义元类" class="headerlink" title="自定义元类"></a>自定义元类</h2><p>你决定在你的模块⾥所有的类的属性都应该是⼤写形式。有好⼏种⽅法可以办到，但其中⼀种就是通过在模块级别设定<code>__metaclass__</code>采⽤这种⽅法，这个模块中的所有类都会通过这个元类来创建，我们只需要告诉元类把所有的属性都改成⼤写形式就万事⼤吉了！</p>
<p>Python2.x中的写法：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#-*- coding:utf-8 -*-</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">upper_attr</span><span class="params">(future_class_name, future_class_parents, future_class_attr)</span>:</span></span><br><span class="line">    </span><br><span class="line">    <span class="comment"># 便利属性字典，将不是__开头的属性名字变为大写</span></span><br><span class="line">    newAttr = &#123;&#125;</span><br><span class="line">    <span class="keyword">for</span> name,value <span class="keyword">in</span> future_class_attr.items():</span><br><span class="line">        <span class="keyword">if</span> <span class="keyword">not</span> name.startswith(<span class="string">"__"</span>):</span><br><span class="line">            newAttr[name.upper()] = value</span><br><span class="line"></span><br><span class="line">    <span class="comment"># 调用type来创建一个类</span></span><br><span class="line">    <span class="keyword">return</span> type(future_class_name,future_class_parents, newAttr)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Foo</span><span class="params">(object)</span>:</span></span><br><span class="line">    __metaclass__ = upper_attr <span class="comment"># 设置Foo类的元类为upper_attr</span></span><br><span class="line">    bar = <span class="string">'bip'</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">print(hasattr(Foo, <span class="string">'bar'</span>))</span><br><span class="line">print(hasattr(Foo, <span class="string">'BAR'</span>))</span><br><span class="line"></span><br><span class="line">f = Foo()</span><br><span class="line">print(f.BAR)</span><br></pre></td></tr></table></figure>

<p>Python3.x的写法</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#-*- coding:utf-8 -*-</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">upper_attr</span><span class="params">(future_class_name, future_class_parents, future_class_attr)</span>:</span></span><br><span class="line">    </span><br><span class="line">    <span class="comment"># 便利属性字典，将不是__开头的属性名字变为大写</span></span><br><span class="line">    newAttr = &#123;&#125;</span><br><span class="line">    <span class="keyword">for</span> name,value <span class="keyword">in</span> future_class_attr.items():</span><br><span class="line">        <span class="keyword">if</span> <span class="keyword">not</span> name.startswith(<span class="string">"__"</span>):</span><br><span class="line">            newAttr[name.upper()] = value</span><br><span class="line"></span><br><span class="line">    <span class="comment"># 调用type来创建一个类</span></span><br><span class="line">    <span class="keyword">return</span> type(future_class_name,future_class_parents, newAttr)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Foo</span><span class="params">(object, metaclass=upper_attr)</span>:</span> <span class="comment"># 设置Foo类的元类为upper_attr</span></span><br><span class="line">    </span><br><span class="line">    bar = <span class="string">'bip'</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">print(hasattr(Foo, <span class="string">'bar'</span>))</span><br><span class="line">print(hasattr(Foo, <span class="string">'BAR'</span>))</span><br><span class="line"></span><br><span class="line">f = Foo()</span><br><span class="line">print(f.BAR)</span><br></pre></td></tr></table></figure>

<p>两者的区别只是<code>__metaclass</code>的位置不一样！</p>
<p>就是这样，除此之外，关于元类真的没有别的可说的了。但就元类本身⽽<br>⾔，它们其实是很简单的：</p>
<ul>
<li>拦截类的创建</li>
<li>修改类</li>
<li>返回修改之后的类</li>
</ul>
<p>“Yuan is the magic of depth, and 99% of households should not have to do so. If you want to find out if you need to go to a meta class, you don’t need it. Those that are actually metaclasses often know exactly what they need to do, and there is no need to explain why they need metaclasses at all. “ Tim Peters, the leader of the Python world！</p>
<h1 id="模块重新导入"><a href="#模块重新导入" class="headerlink" title="模块重新导入"></a>模块重新导入</h1><p><code>import XXX</code>是在当前目录找模块，如果需要其他路径的模块：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">import</span> sys</span><br><span class="line">sys.path.append(<span class="string">"XXX路径"</span>)</span><br></pre></td></tr></table></figure>

<p>如果在导入模块之后，模块又发生了修改，此时需要重新导入</p>
<p><code>reload(模块名)</code>这样便可以重新加载模块，使用此函数的前提是<code>form imp import *</code></p>
<h1 id="循环导入"><a href="#循环导入" class="headerlink" title="循环导入"></a>循环导入</h1><h2 id="循环导入的概念"><a href="#循环导入的概念" class="headerlink" title="循环导入的概念"></a>循环导入的概念</h2><p>a.py</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> b <span class="keyword">import</span> b</span><br><span class="line"></span><br><span class="line"><span class="keyword">print</span> <span class="string">'---------this is module a.py----------'</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">a</span><span class="params">()</span>:</span></span><br><span class="line">	print(<span class="string">"hello, a"</span>)</span><br><span class="line">	b()</span><br><span class="line">	</span><br><span class="line">a()</span><br></pre></td></tr></table></figure>

<p>b.py</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> a <span class="keyword">import</span> a</span><br><span class="line"></span><br><span class="line"><span class="keyword">print</span> <span class="string">'----------this is module b.py----------'</span></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">b</span><span class="params">()</span>:</span></span><br><span class="line">	print(<span class="string">"hello, b"</span>)</span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">c</span><span class="params">()</span>:</span></span><br><span class="line">	a()</span><br><span class="line">c()</span><br></pre></td></tr></table></figure>

<p>运行a.py发现a和b这两个模块是相互导入的，这样就会出现循环导入的问题！</p>
<h2 id="怎样避免循环导入"><a href="#怎样避免循环导入" class="headerlink" title="怎样避免循环导入"></a>怎样避免循环导入</h2><ul>
<li>程序设计上分层，降低耦合</li>
<li>导入语句放在后面需要导入时再导入，例如放在函数体内导入</li>
</ul>
<h1 id="进制与位运算"><a href="#进制与位运算" class="headerlink" title="进制与位运算"></a>进制与位运算</h1><h3 id="原码、反码与补码"><a href="#原码、反码与补码" class="headerlink" title="原码、反码与补码"></a>原码、反码与补码</h3><ul>
<li><p>在计算机用一个数的最高位存放符号， 正数为0， 负数为1</p>
</li>
<li><p>正数的原反补码都一样</p>
</li>
<li><p>负数的反码是在原码的基础上，符号位不变其他位取反</p>
</li>
<li><p>负数的补码是在反码的基础上+1</p>
</li>
</ul>
<blockquote>
<p><strong>负数从补码转换为原码的规则：补码的符号位不变——&gt;数据位取反——&gt;尾部+1</strong></p>
</blockquote>
<h2 id="进制转换"><a href="#进制转换" class="headerlink" title="进制转换"></a>进制转换</h2><p>二进制是以<code>0b</code>开头，十六进制以<code>0x</code>开头</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 十进制转二进制</span></span><br><span class="line">In [<span class="number">1</span>]: bin(<span class="number">10</span>)</span><br><span class="line">Out[<span class="number">1</span>]: <span class="string">'0b1010'</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 二进制转十进制</span></span><br><span class="line">In [<span class="number">2</span>]: int(<span class="string">"1001"</span>, <span class="number">2</span>)</span><br><span class="line">Out[<span class="number">2</span>]: <span class="number">9</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 十进制转十六进制</span></span><br><span class="line">In [<span class="number">3</span>]: hex(<span class="number">10</span>)</span><br><span class="line">Out[<span class="number">3</span>]: <span class="string">'0xa'</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 十六进制转十进制</span></span><br><span class="line">In [<span class="number">4</span>]: int(<span class="string">"ff"</span>,<span class="number">16</span>)</span><br><span class="line">Out[<span class="number">4</span>]: <span class="number">255</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 十六进制转二进制</span></span><br><span class="line">In [<span class="number">5</span>]: bin(<span class="number">0xa</span>)</span><br><span class="line">Out[<span class="number">5</span>]: <span class="string">'0b1010'</span></span><br></pre></td></tr></table></figure>
<p><img src="https://img.zouchanglin.cn/blog/20200822/oPoxjDVFxmsN.png" alt="mark"></p>
<h2 id="位运算"><a href="#位运算" class="headerlink" title="位运算"></a>位运算</h2><ul>
<li>按位与<code>&amp;</code>：全为1结果才是1</li>
<li>按位或<code>|</code>：只要有一个为0结果就是1</li>
<li>按位异或<code>^</code>：只要不相同就是1</li>
<li>按位取反<code>~</code>：各个位于原来的相反</li>
<li>按位左移<code>&lt;&lt;</code>：各个二进制位全部左移n位，低位补0</li>
<li>按位右移<code>&gt;&gt;</code>：各个二进制位全部右移n位，保持符号位不变</li>
</ul>
<h2 id="位运算交换两个数"><a href="#位运算交换两个数" class="headerlink" title="位运算交换两个数"></a>位运算交换两个数</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#-*- coding:utf-8 -*-</span></span><br><span class="line">a = <span class="number">10</span></span><br><span class="line">b = <span class="number">20</span></span><br><span class="line"></span><br><span class="line">a = a^b</span><br><span class="line">b = a^b</span><br><span class="line">a = a^b</span><br><span class="line"></span><br><span class="line">print(a)</span><br><span class="line">print(b)</span><br></pre></td></tr></table></figure>
<h1 id="私有化"><a href="#私有化" class="headerlink" title="私有化"></a>私有化</h1><ul>
<li>xx: 公有变量</li>
<li>_x: 单前置下划线,私有化属性或方法，from somemodule import *禁止导入,类对象和子类可以访问</li>
<li>__xx：双前置下划线,避免与子类中的属性命名冲突，无法在外部直接访问(名字重整所以访问不到)</li>
<li>__xx__:双前后下划线,用户名字空间的魔法对象或属性。例如: __init__ , 不要自己发明这样的名字</li>
<li>xx_:单后置下划线,用于避免与Python关键词的冲突</li>
</ul>
<h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><ul>
<li>父类中属性名为<code>__名字</code>的，子类不继承，子类不能访问</li>
<li>如果在子类中向 __名字 赋值，那么会在子类中定义的一个与父类相同名字的属性</li>
<li><code>_名字</code> 的变量、函数、类在使用<code>from xxx import *</code>时都不会被导入</li>
</ul>
<h1 id="属性property"><a href="#属性property" class="headerlink" title="属性property"></a>属性property</h1><h2 id="私有属性添加getter和setter方法"><a href="#私有属性添加getter和setter方法" class="headerlink" title="私有属性添加getter和setter方法"></a>私有属性添加getter和setter方法</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Money</span><span class="params">(object)</span>:</span></span><br><span class="line">	<span class="function"><span class="keyword">def</span> <span class="title">__init__</span><span class="params">(self)</span>:</span></span><br><span class="line">	self.__money = <span class="number">0</span></span><br><span class="line">    </span><br><span class="line">	<span class="function"><span class="keyword">def</span> <span class="title">getMoney</span><span class="params">(self)</span>:</span></span><br><span class="line">		<span class="keyword">return</span> self.__money</span><br><span class="line">    </span><br><span class="line">	<span class="function"><span class="keyword">def</span> <span class="title">setMoney</span><span class="params">(self, value)</span>:</span></span><br><span class="line">		<span class="keyword">if</span> isinstance(value, int):</span><br><span class="line">			self.__money = value</span><br><span class="line">		<span class="keyword">else</span>:</span><br><span class="line">			print(<span class="string">"error:不是整型数字"</span>)</span><br></pre></td></tr></table></figure>

<h2 id="使用property升级getter和setter方法"><a href="#使用property升级getter和setter方法" class="headerlink" title="使用property升级getter和setter方法"></a>使用property升级getter和setter方法</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Money</span><span class="params">(object)</span>:</span></span><br><span class="line">	<span class="function"><span class="keyword">def</span> <span class="title">__init__</span><span class="params">(self)</span>:</span></span><br><span class="line">	self.__money = <span class="number">0</span></span><br><span class="line">	</span><br><span class="line">	<span class="function"><span class="keyword">def</span> <span class="title">getMoney</span><span class="params">(self)</span>:</span></span><br><span class="line">		<span class="keyword">return</span> self.__money</span><br><span class="line">		</span><br><span class="line">	<span class="function"><span class="keyword">def</span> <span class="title">setMoney</span><span class="params">(self, value)</span>:</span></span><br><span class="line">		<span class="keyword">if</span> isinstance(value, int):</span><br><span class="line">			self.__money = value</span><br><span class="line">		<span class="keyword">else</span>:</span><br><span class="line">			print(<span class="string">"error:不是整型数字"</span>)</span><br><span class="line">	money = property(getMoney, setMoney)</span><br></pre></td></tr></table></figure>

<h2 id="使用property取代getter和setter方法"><a href="#使用property取代getter和setter方法" class="headerlink" title="使用property取代getter和setter方法"></a>使用property取代getter和setter方法</h2><p><code>@property</code>成为属性函数。可以对属性赋值时作必要的检查，并且保证代码的清晰短小</p>
<ul>
<li>将方法转换为只读</li>
<li>重新实现一个属性的设置和读取方法,可做边界判定</li>
</ul>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Money</span><span class="params">(object)</span>:</span></span><br><span class="line">	<span class="function"><span class="keyword">def</span> <span class="title">__init__</span><span class="params">(self)</span>:</span></span><br><span class="line">		self.__money = <span class="number">0</span></span><br><span class="line"><span class="meta">	@property</span></span><br><span class="line">	<span class="function"><span class="keyword">def</span> <span class="title">money</span><span class="params">(self)</span>:</span></span><br><span class="line">		<span class="keyword">return</span> self.__money</span><br><span class="line">    </span><br><span class="line"><span class="meta">    @money.setter</span></span><br><span class="line">	<span class="function"><span class="keyword">def</span> <span class="title">money</span><span class="params">(self, value)</span>:</span></span><br><span class="line">		<span class="keyword">if</span> isinstance(value, int):</span><br><span class="line">			self.__money = value</span><br><span class="line">		<span class="keyword">else</span>:</span><br><span class="line">			print(<span class="string">"error:不是整型数字"</span>)</span><br></pre></td></tr></table></figure>

<p><strong>这样访问是就可以直接使用<code>对象.属性</code>的方式访问，但是本质还是去调用方法！</strong></p>

	


    
    <div class="page-reward">
      <a href="javascript:void(0);" class="page-reward-btn tooltip-top" target="_self">
        <div class="tooltip tooltip-east">
          <span class="tooltip-item">
            赏
          </span>
          <span class="tooltip-content">
            <span class="tooltip-text">
              <span class="tooltip-inner">
                <p class="reward-p"><i class="icon icon-quo-left"></i>谢谢你请我喝咖啡<i
                    class="icon icon-quo-right"></i></p>
                <div class="reward-box">
                  
                  <div class="reward-box-item">
                    <img class="reward-img" src="https://img.zouchanglin.cn/20201201190211.png">
                    <span class="reward-type">支付宝</span>
                  </div>
                  
                  
                  <div class="reward-box-item">
                    <img class="reward-img" src="https://img.zouchanglin.cn/20201201190247.png">
                    <span class="reward-type">微信</span>
                  </div>
                  
                </div>
              </span>
            </span>
          </span>
        </div>
      </a>
    </div>
    

    
    <div class="declare"> 
      <ul class="post-copyright">
        <li>
          <strong>本文作者：</strong>
          Tim
        </li>
        <li>
          <strong>本文链接：</strong>
          <a href="https://zouchanglin.cn/2018/01/21/3674622550.html" title="Python语法学习日志" target="_blank">https://zouchanglin.cn/2018/01/21/3674622550.html</a>
        </li>
        
        <li>
          <strong>版权声明： </strong>
          
          本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-sa/4.0/" rel="external nofollow" target="_blank">CC BY-SA 4.0</a> 许可协议。转载请注明出处！
        </li>
        
      </ul>
    </div>
    

  </div>
  <div class="article-info article-info-index">
    
    
	<div class="article-tag tagcloud">
		<i class="icon-price-tags icon"></i>
		<ul class="article-tag-list">
			 
        		<li class="article-tag-list-item">
        			<a href="javascript:void(0)" class="js-tag article-tag-list-link color2">Python</a>
        		</li>
      		
		</ul>
	</div>

    
	<div class="article-category tagcloud">
		<i class="icon-book icon"></i>
		<ul class="article-tag-list">
			 
        		<li class="article-tag-list-item">
        			<a href="/categories/编程语言//" class="article-tag-list-link color5">编程语言</a>
        		</li>
      		
		</ul>
	</div>


    
	
    
    
<div class="share-btn share-icons tooltip-left">
  <div class="tooltip tooltip-east">
    <span class="tooltip-item">
      <a href="javascript:;" class="share-sns share-outer">
        <i class="icon icon-share"></i>
      </a>
    </span>
    <span class="tooltip-content">
      <div class="share-wrap">
        <div class="share-icons">
          <a class="weibo share-sns" href="javascript:;" data-type="weibo">
            <i class="icon icon-weibo"></i>
          </a>
          <!-- <a class="weixin share-sns wxFab" href="javascript:;" data-type="weixin">
            <i class="icon icon-weixin"></i>
          </a> -->
          <a class="qq share-sns" href="javascript:;" data-type="qq">
            <i class="icon icon-qq"></i>
          </a>
          <a class="douban share-sns" href="javascript:;" data-type="douban">
            <i class="icon icon-douban"></i>
          </a>
          <a class="qzone share-sns" href="javascript:;" data-type="qzone">
            <i class="icon icon-qzone"></i>
          </a>
          <a class="facebook share-sns" href="javascript:;" data-type="facebook">
            <i class="icon icon-facebook"></i>
          </a>
          <a class="twitter share-sns" href="javascript:;" data-type="twitter">
            <i class="icon icon-twitter"></i>
          </a>
          <a class="google share-sns" href="javascript:;" data-type="google">
            <i class="icon icon-google"></i>
          </a>
        </div>
      </div>
    </span>
  </div>
</div>

<div class="page-modal wx-share js-wx-box">
    <a class="close js-modal-close" href="javascript:;"><i class="icon icon-close"></i></a>
    <p>扫一扫，分享到微信</p>
    <div class="wx-qrcode">
     <!-- <img src="//pan.baidu.com/share/qrcode?url=https://zouchanglin.cn/2018/01/21/3674622550.html" alt="微信分享二维码"> -->
    </div>
</div>

<div class="mask js-mask"></div>

    
    <div class="clearfix"></div>
  </div>
  </div>
</article>


<nav id="article-nav">
  
    <a href="/2018/01/25/397426745.html" id="article-nav-newer" class="article-nav-link-wrap">
      <i class="icon-circle-left"></i>
      <div class="article-nav-title">
        
          生成器、迭代器、闭包与装饰器
        
      </div>
    </a>
  
  
    <a href="/2017/12/21/821330466.html" id="article-nav-older" class="article-nav-link-wrap">
      <div class="article-nav-title">Ajax异步请求与JSON数据格式</div>
      <i class="icon-circle-right"></i>
    </a>
  
</nav>


<aside class="wrap-side-operation">
    <div class="mod-side-operation">
        
        <div class="jump-container" id="js-jump-container" style="display:none;">
            <a href="javascript:void(0)" class="mod-side-operation__jump-to-top">
                <i class="icon-font icon-back"></i>
            </a>
            <div id="js-jump-plan-container" class="jump-plan-container" style="top: -11px;">
                <i class="icon-font icon-plane jump-plane"></i>
            </div>
        </div>
        
        
        <div class="toc-container tooltip-left">
            <i class="icon-font icon-category"></i>
            <div class="tooltip tooltip-east">
                <span class="tooltip-item">
                </span>
                <span class="tooltip-content">
                    <div class="toc-article">
                    <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#编译器与解释器"><span class="toc-number">1.</span> <span class="toc-text">编译器与解释器</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#编译型与解释型速度"><span class="toc-number">2.</span> <span class="toc-text">编译型与解释型速度</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Python的特点"><span class="toc-number">3.</span> <span class="toc-text">Python的特点</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Python解析器对应名称"><span class="toc-number">4.</span> <span class="toc-text">Python解析器对应名称</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#执行Python程序的三种方法"><span class="toc-number">5.</span> <span class="toc-text">执行Python程序的三种方法</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Python的注释"><span class="toc-number">6.</span> <span class="toc-text">Python的注释</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Python的运算符"><span class="toc-number">7.</span> <span class="toc-text">Python的运算符</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Python程序的执行原理"><span class="toc-number">8.</span> <span class="toc-text">Python程序的执行原理</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#不同变量之间的计算"><span class="toc-number">9.</span> <span class="toc-text">不同变量之间的计算</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Python的输入函数"><span class="toc-number">10.</span> <span class="toc-text">Python的输入函数</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#类型转换函数"><span class="toc-number">11.</span> <span class="toc-text">类型转换函数</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#print-函数的格式化输出"><span class="toc-number">11.1.</span> <span class="toc-text">print()函数的格式化输出</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#查看python的关键字"><span class="toc-number">12.</span> <span class="toc-text">查看python的关键字</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#关于4空格与tab键"><span class="toc-number">13.</span> <span class="toc-text">关于4空格与tab键</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#python中的逻辑运算符-and、or、not"><span class="toc-number">14.</span> <span class="toc-text">python中的逻辑运算符 and、or、not</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#pycharm使用技巧"><span class="toc-number">15.</span> <span class="toc-text">pycharm使用技巧</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#python需要注意的地方"><span class="toc-number">16.</span> <span class="toc-text">python需要注意的地方</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#常见转义字符："><span class="toc-number">17.</span> <span class="toc-text">常见转义字符：</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#函数封装"><span class="toc-number">18.</span> <span class="toc-text">函数封装</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#pycharm调试工具"><span class="toc-number">19.</span> <span class="toc-text">pycharm调试工具</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#函数的注释方式："><span class="toc-number">20.</span> <span class="toc-text">函数的注释方式：</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#模块的概念"><span class="toc-number">21.</span> <span class="toc-text">模块的概念</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#python中的数据类型"><span class="toc-number">22.</span> <span class="toc-text">python中的数据类型</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#列表：list"><span class="toc-number">23.</span> <span class="toc-text">列表：list</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#列表的方法"><span class="toc-number">23.1.</span> <span class="toc-text">列表的方法</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#元组-：tuple"><span class="toc-number">24.</span> <span class="toc-text">元组 ：tuple</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#列表和元组之间的转换函数"><span class="toc-number">24.1.</span> <span class="toc-text">列表和元组之间的转换函数</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#字典-dictionary"><span class="toc-number">25.</span> <span class="toc-text">字典 dictionary</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#字符串"><span class="toc-number">26.</span> <span class="toc-text">字符串</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#字符串的常见操作"><span class="toc-number">27.</span> <span class="toc-text">字符串的常见操作</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#其他"><span class="toc-number">28.</span> <span class="toc-text">其他</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#全局变量"><span class="toc-number">29.</span> <span class="toc-text">全局变量</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#代码结构的定义规范"><span class="toc-number">30.</span> <span class="toc-text">代码结构的定义规范</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#函数返回值"><span class="toc-number">31.</span> <span class="toc-text">函数返回值</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Python交换数字的特殊方式"><span class="toc-number">32.</span> <span class="toc-text">Python交换数字的特殊方式</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#函数的参数"><span class="toc-number">33.</span> <span class="toc-text">函数的参数</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#缺省参数"><span class="toc-number">34.</span> <span class="toc-text">缺省参数</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#定义"><span class="toc-number">34.1.</span> <span class="toc-text">定义</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#使用场景"><span class="toc-number">34.2.</span> <span class="toc-text">使用场景</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#注意点"><span class="toc-number">34.3.</span> <span class="toc-text">注意点</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#多值参数"><span class="toc-number">35.</span> <span class="toc-text">多值参数</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#元组的字典的拆包"><span class="toc-number">36.</span> <span class="toc-text">元组的字典的拆包</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#函数递归"><span class="toc-number">37.</span> <span class="toc-text">函数递归</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#面向对象"><span class="toc-number"></span> <span class="toc-text">面向对象</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#dir内置函数"><span class="toc-number">1.</span> <span class="toc-text">dir内置函数</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#self参数"><span class="toc-number">2.</span> <span class="toc-text">self参数</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#init-方法"><span class="toc-number">3.</span> <span class="toc-text">__init__方法</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#del-方法"><span class="toc-number">4.</span> <span class="toc-text">__del__方法</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#应用场景"><span class="toc-number">4.1.</span> <span class="toc-text">应用场景</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#生命周期"><span class="toc-number">4.2.</span> <span class="toc-text">生命周期</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#str-方法"><span class="toc-number">5.</span> <span class="toc-text">__str__方法</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#身份运算符"><span class="toc-number">6.</span> <span class="toc-text">身份运算符</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#私有属性和私有方法"><span class="toc-number">7.</span> <span class="toc-text">私有属性和私有方法</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#定义方式"><span class="toc-number">7.1.</span> <span class="toc-text">定义方式</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#伪私有属性和私有方法"><span class="toc-number">7.2.</span> <span class="toc-text">伪私有属性和私有方法</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#继承"><span class="toc-number">8.</span> <span class="toc-text">继承</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#方法重写"><span class="toc-number">8.1.</span> <span class="toc-text">方法重写</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#关于super"><span class="toc-number">8.2.</span> <span class="toc-text">关于super</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#父类的私有属性和私有方法"><span class="toc-number">9.</span> <span class="toc-text">父类的私有属性和私有方法</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#多继承"><span class="toc-number">10.</span> <span class="toc-text">多继承</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#Python中的MRO-–-方法搜索顺序"><span class="toc-number">10.1.</span> <span class="toc-text">Python中的MRO – 方法搜索顺序</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#新式类与旧式-经典-类"><span class="toc-number">10.2.</span> <span class="toc-text">新式类与旧式(经典)类</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#多态"><span class="toc-number">11.</span> <span class="toc-text">多态</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Python中一切皆对象"><span class="toc-number">12.</span> <span class="toc-text">Python中一切皆对象</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#类属性和实例属性"><span class="toc-number">13.</span> <span class="toc-text">类属性和实例属性</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#属性的获取机制"><span class="toc-number">13.1.</span> <span class="toc-text">属性的获取机制</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#类方法与静态方法"><span class="toc-number">14.</span> <span class="toc-text">类方法与静态方法</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#类方法"><span class="toc-number">14.1.</span> <span class="toc-text">类方法</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#静态方法"><span class="toc-number">14.2.</span> <span class="toc-text">静态方法</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#单例模式"><span class="toc-number">15.</span> <span class="toc-text">单例模式</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#new-方法"><span class="toc-number">15.1.</span> <span class="toc-text">__new__方法</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#异常"><span class="toc-number">16.</span> <span class="toc-text">异常</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#捕获异常"><span class="toc-number">16.1.</span> <span class="toc-text">捕获异常</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#捕获异常的完整语法"><span class="toc-number">16.2.</span> <span class="toc-text">捕获异常的完整语法</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#异常的传递"><span class="toc-number">16.3.</span> <span class="toc-text">异常的传递</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#手动抛出异常"><span class="toc-number">16.4.</span> <span class="toc-text">手动抛出异常</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#模块"><span class="toc-number">17.</span> <span class="toc-text">模块</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#模块的搜索顺序"><span class="toc-number">17.0.1.</span> <span class="toc-text">模块的搜索顺序</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#原则–每一个文件都应该是可以被导入的"><span class="toc-number">17.1.</span> <span class="toc-text">原则–每一个文件都应该是可以被导入的</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#name-属性"><span class="toc-number">17.1.1.</span> <span class="toc-text">__name__属性</span></a></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#包（Package"><span class="toc-number">18.</span> <span class="toc-text">包（Package)</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#init-py"><span class="toc-number">18.1.</span> <span class="toc-text">__init__.py</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#发布压缩包的制作"><span class="toc-number">18.2.</span> <span class="toc-text">发布压缩包的制作</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#安装-卸载模块"><span class="toc-number">18.3.</span> <span class="toc-text">安装&#x2F;卸载模块</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#pip安装第三方模块"><span class="toc-number">19.</span> <span class="toc-text">pip安装第三方模块</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#文件"><span class="toc-number">20.</span> <span class="toc-text">文件</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#文件-目录的常用管理操作"><span class="toc-number">21.</span> <span class="toc-text">文件&#x2F;目录的常用管理操作</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#文件操作"><span class="toc-number">21.1.</span> <span class="toc-text">文件操作</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#目录操作"><span class="toc-number">21.2.</span> <span class="toc-text">目录操作</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#文本文件的编码格式"><span class="toc-number">21.3.</span> <span class="toc-text">文本文件的编码格式</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#eval函数"><span class="toc-number">22.</span> <span class="toc-text">eval函数</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#、is"><span class="toc-number"></span> <span class="toc-text">&#x3D;&#x3D;、is</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#深拷贝与浅拷贝"><span class="toc-number"></span> <span class="toc-text">深拷贝与浅拷贝</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#深拷贝是真的深！"><span class="toc-number">1.</span> <span class="toc-text">深拷贝是真的深！</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#拷贝的其他方式"><span class="toc-number">2.</span> <span class="toc-text">拷贝的其他方式</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#浅拷贝对不可变类型和可变类型的拷贝不同"><span class="toc-number">2.1.</span> <span class="toc-text">浅拷贝对不可变类型和可变类型的拷贝不同</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#分片表达式可以构造一个序列"><span class="toc-number">2.2.</span> <span class="toc-text">分片表达式可以构造一个序列</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#字典的copy方法可以拷贝一个字典"><span class="toc-number">2.3.</span> <span class="toc-text">字典的copy方法可以拷贝一个字典</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#有些内置函数可以生成拷贝"><span class="toc-number">2.4.</span> <span class="toc-text">有些内置函数可以生成拷贝</span></a></li></ol></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Python是动态语言"><span class="toc-number"></span> <span class="toc-text">Python是动态语言</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#运行的过程中给对象绑定-添加-属性"><span class="toc-number">1.</span> <span class="toc-text">运行的过程中给对象绑定(添加)属性</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#运行的过程中给类绑定-添加-属性"><span class="toc-number">2.</span> <span class="toc-text">运行的过程中给类绑定(添加)属性</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#运行的过程中给类绑定-添加-方法"><span class="toc-number">3.</span> <span class="toc-text">运行的过程中给类绑定(添加)方法</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#slots"><span class="toc-number"></span> <span class="toc-text">__slots__</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#元类"><span class="toc-number"></span> <span class="toc-text">元类</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#类也是对象"><span class="toc-number">1.</span> <span class="toc-text">类也是对象</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#动态地创建类"><span class="toc-number">2.</span> <span class="toc-text">动态地创建类</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#使用type创建类"><span class="toc-number">3.</span> <span class="toc-text">使用type创建类</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#type创建类的格式"><span class="toc-number">3.1.</span> <span class="toc-text">type创建类的格式</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#使用Type创建带属性的类"><span class="toc-number">4.</span> <span class="toc-text">使用Type创建带属性的类</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#使⽤type创建带有⽅法的类"><span class="toc-number">5.</span> <span class="toc-text">使⽤type创建带有⽅法的类</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#添加静态方法"><span class="toc-number">5.1.</span> <span class="toc-text">添加静态方法</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#添加类方法"><span class="toc-number">5.2.</span> <span class="toc-text">添加类方法</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#元类的概念"><span class="toc-number">6.</span> <span class="toc-text">元类的概念</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#metaclass-属性"><span class="toc-number">7.</span> <span class="toc-text">__metaclass__属性</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#自定义元类"><span class="toc-number">8.</span> <span class="toc-text">自定义元类</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#模块重新导入"><span class="toc-number"></span> <span class="toc-text">模块重新导入</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#循环导入"><span class="toc-number"></span> <span class="toc-text">循环导入</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#循环导入的概念"><span class="toc-number">1.</span> <span class="toc-text">循环导入的概念</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#怎样避免循环导入"><span class="toc-number">2.</span> <span class="toc-text">怎样避免循环导入</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#进制与位运算"><span class="toc-number"></span> <span class="toc-text">进制与位运算</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#原码、反码与补码"><span class="toc-number">0.1.</span> <span class="toc-text">原码、反码与补码</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#进制转换"><span class="toc-number">1.</span> <span class="toc-text">进制转换</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#位运算"><span class="toc-number">2.</span> <span class="toc-text">位运算</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#位运算交换两个数"><span class="toc-number">3.</span> <span class="toc-text">位运算交换两个数</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#私有化"><span class="toc-number"></span> <span class="toc-text">私有化</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#总结"><span class="toc-number">1.</span> <span class="toc-text">总结</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#属性property"><span class="toc-number"></span> <span class="toc-text">属性property</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#私有属性添加getter和setter方法"><span class="toc-number">1.</span> <span class="toc-text">私有属性添加getter和setter方法</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#使用property升级getter和setter方法"><span class="toc-number">2.</span> <span class="toc-text">使用property升级getter和setter方法</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#使用property取代getter和setter方法"><span class="toc-number">3.</span> <span class="toc-text">使用property取代getter和setter方法</span></a></li></ol>
                    </div>
                </span>
            </div>
        </div>
        
    </div>
</aside>






<!-- 自己加的 -->
<iframe id="comment-box" width="100%" height="700" frameborder="0">
			您的浏览器不支持iframe，请升级
</iframe>
<script>
	document.getElementById('comment-box').src = 'https://comment.zouchanglin.cn/?url=' + window.location.href;
</script>








          </div>
        </div>
      </div>
      <footer id="footer">
  <div class="outer">
    <div id="footer-info">
    	<div class="footer-left">
    		&copy; 2017-2020 <a href="https://zouchanglin.cn/" target="_blank">Tim</a>
    	</div>
      	<!-- <div class="footer-right">
			
			
      		GitHub:<a href="https://github.com/JoeyBling/hexo-theme-yilia-plus" target="_blank">hexo-theme-yilia-plus</a> by Litten
      	</div> -->
    </div>
  </div>
  
  
	<script src="/lib/busuanzi.pure.js"></script>
	
  
  
	
	<span id="busuanzi_container_site_pv" style="display:none">
		本站总访问量<span id="busuanzi_value_site_pv"></span>次	
	        <span class="post-meta-divider" >|</span>
	</span>
  	<span id="busuanzi_container_site_uv" style='display:none'>
  		本站访客数<span id="busuanzi_value_site_uv"></span>人
  	</span>
  
</footer>

    </div>
    <script>
	var yiliaConfig = {
		mathjax: true,
		isHome: false,
		isPost: true,
		isArchive: false,
		isTag: false,
		isCategory: false,
		open_in_new: true,
		toc_hide_index: true,
		root: "/",
		innerArchive: true,
		showTags: true
	}
</script>

<script>!function(r){function e(t){if(i[t])return i[t].exports;var n=i[t]={exports:{},id:t,loaded:!1};return r[t].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i={};e.m=r,e.c=i,e.p="./",e(0)}([function(t,n,r){r(208),t.exports=r(205)},function(t,n,r){var d=r(3),y=r(46),g=r(26),b=r(27),x=r(47),m="prototype",S=function(t,n,r){var e,i,o,u,c=t&S.F,f=t&S.G,a=t&S.S,s=t&S.P,l=t&S.B,h=f?d:a?d[n]||(d[n]={}):(d[n]||{})[m],v=f?y:y[n]||(y[n]={}),p=v[m]||(v[m]={});for(e in f&&(r=n),r)o=((i=!c&&h&&void 0!==h[e])?h:r)[e],u=l&&i?x(o,d):s&&"function"==typeof o?x(Function.call,o):o,h&&b(h,e,o,t&S.U),v[e]!=o&&g(v,e,u),s&&p[e]!=o&&(p[e]=o)};d.core=y,S.F=1,S.G=2,S.S=4,S.P=8,S.B=16,S.W=32,S.U=64,S.R=128,t.exports=S},function(t,n,r){var e=r(5);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,n,r){var e=r(118)("wks"),i=r(79),o=r(3).Symbol,u="function"==typeof o;(t.exports=function(t){return e[t]||(e[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=e},function(t,n,r){var e=r(49),i=Math.min;t.exports=function(t){return 0<t?i(e(t),9007199254740991):0}},function(t,n){var r={}.hasOwnProperty;t.exports=function(t,n){return r.call(t,n)}},function(t,n,r){t.exports=!r(4)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n,r){var e=r(2),i=r(174),o=r(53),u=Object.defineProperty;n.f=r(10)?Object.defineProperty:function(t,n,r){if(e(t),n=o(n,!0),e(r),i)try{return u(t,n,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},function(t,n,r){t.exports=!r(20)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n,r){var e=r(14),i=r(24);t.exports=r(12)?function(t,n,r){return e.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n,r){var e=r(22),i=r(60),o=r(42),u=Object.defineProperty;n.f=r(12)?Object.defineProperty:function(t,n,r){if(e(t),n=o(n,!0),e(r),i)try{return u(t,n,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},function(t,n,r){var e=r(96),i=r(34);t.exports=function(t){return e(i(t))}},function(t,n,r){var e=r(40)("wks"),i=r(25),o=r(6).Symbol,u="function"==typeof o;(t.exports=function(t){return e[t]||(e[t]=u&&o[t]||(u?o:i)("Symbol."+t))}).store=e},function(t,n,r){var e=r(51);t.exports=function(t){return Object(e(t))}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n){var r=t.exports={version:"2.6.9"};"number"==typeof __e&&(__e=r)},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n,r){var e=r(18);t.exports=function(t){if(!e(t))throw TypeError(t+" is not an object!");return t}},function(t,n){t.exports=!0},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+e).toString(36))}},function(t,n,r){var e=r(11),i=r(75);t.exports=r(10)?function(t,n,r){return e.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n,r){var o=r(3),u=r(26),c=r(30),f=r(79)("src"),e=r(219),i="toString",a=(""+e).split(i);r(46).inspectSource=function(t){return e.call(t)},(t.exports=function(t,n,r,e){var i="function"==typeof r;i&&(c(r,"name")||u(r,"name",n)),t[n]!==r&&(i&&(c(r,f)||u(r,f,t[n]?""+t[n]:a.join(String(n)))),t===o?t[n]=r:e?t[n]?t[n]=r:u(t,n,r):(delete t[n],u(t,n,r)))})(Function.prototype,i,function(){return"function"==typeof this&&this[f]||e.call(this)})},function(t,n,r){var e=r(1),i=r(4),u=r(51),c=/"/g,o=function(t,n,r,e){var i=String(u(t)),o="<"+n;return""!==r&&(o+=" "+r+'="'+String(e).replace(c,"&quot;")+'"'),o+">"+i+"</"+n+">"};t.exports=function(n,t){var r={};r[n]=t(o),e(e.P+e.F*i(function(){var t=""[n]('"');return t!==t.toLowerCase()||3<t.split('"').length}),"String",r)}},function(t,n,r){var e=r(65),i=r(35);t.exports=Object.keys||function(t){return e(t,i)}},function(t,n){var r={}.hasOwnProperty;t.exports=function(t,n){return r.call(t,n)}},function(t,n,r){var e=r(117),i=r(75),o=r(33),u=r(53),c=r(30),f=r(174),a=Object.getOwnPropertyDescriptor;n.f=r(10)?a:function(t,n){if(t=o(t),n=u(n,!0),f)try{return a(t,n)}catch(t){}if(c(t,n))return i(!e.f.call(t,n),t[n])}},function(t,n,r){var e=r(30),i=r(17),o=r(154)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),e(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,n,r){var e=r(116),i=r(51);t.exports=function(t){return e(i(t))}},function(t,n){t.exports=function(t){if(null==t)throw TypeError("Can't call method on  "+t);return t}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n){t.exports={}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,r){var e=r(14).f,i=r(9),o=r(16)("toStringTag");t.exports=function(t,n,r){t&&!i(t=r?t:t.prototype,o)&&e(t,o,{configurable:!0,value:n})}},function(t,n,r){var e=r(40)("keys"),i=r(25);t.exports=function(t){return e[t]||(e[t]=i(t))}},function(t,n,r){var e=r(19),i=r(6),o="__core-js_shared__",u=i[o]||(i[o]={});(t.exports=function(t,n){return u[t]||(u[t]=void 0!==n?n:{})})("versions",[]).push({version:e.version,mode:r(23)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(0<t?e:r)(t)}},function(t,n,r){var i=r(18);t.exports=function(t,n){if(!i(t))return t;var r,e;if(n&&"function"==typeof(r=t.toString)&&!i(e=r.call(t)))return e;if("function"==typeof(r=t.valueOf)&&!i(e=r.call(t)))return e;if(!n&&"function"==typeof(r=t.toString)&&!i(e=r.call(t)))return e;throw TypeError("Can't convert object to primitive value")}},function(t,n,r){var e=r(6),i=r(19),o=r(23),u=r(44),c=r(14).f;t.exports=function(t){var n=i.Symbol||(i.Symbol=o?{}:e.Symbol||{});"_"==t.charAt(0)||t in n||c(n,t,{value:u.f(t)})}},function(t,n,r){n.f=r(16)},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n){var r=t.exports={version:"2.6.9"};"number"==typeof __e&&(__e=r)},function(t,n,r){var o=r(21);t.exports=function(e,i,t){if(o(e),void 0===i)return e;switch(t){case 1:return function(t){return e.call(i,t)};case 2:return function(t,n){return e.call(i,t,n)};case 3:return function(t,n,r){return e.call(i,t,n,r)}}return function(){return e.apply(i,arguments)}}},function(t,n,r){"use strict";var e=r(4);t.exports=function(t,n){return!!t&&e(function(){n?t.call(null,function(){},1):t.call(null)})}},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(0<t?e:r)(t)}},function(t,n,r){var x=r(47),m=r(116),S=r(17),w=r(8),e=r(138);t.exports=function(l,t){var h=1==l,v=2==l,p=3==l,d=4==l,y=6==l,g=5==l||y,b=t||e;return function(t,n,r){for(var e,i,o=S(t),u=m(o),c=x(n,r,3),f=w(u.length),a=0,s=h?b(t,f):v?b(t,0):void 0;a<f;a++)if((g||a in u)&&(i=c(e=u[a],a,o),l))if(h)s[a]=i;else if(i)switch(l){case 3:return!0;case 5:return e;case 6:return a;case 2:s.push(e)}else if(d)return!1;return y?-1:p||d?d:s}}},function(t,n){t.exports=function(t){if(null==t)throw TypeError("Can't call method on  "+t);return t}},function(t,n,r){var i=r(1),o=r(46),u=r(4);t.exports=function(t,n){var r=(o.Object||{})[t]||Object[t],e={};e[t]=n(r),i(i.S+i.F*u(function(){r(1)}),"Object",e)}},function(t,n,r){var i=r(5);t.exports=function(t,n){if(!i(t))return t;var r,e;if(n&&"function"==typeof(r=t.toString)&&!i(e=r.call(t)))return e;if("function"==typeof(r=t.valueOf)&&!i(e=r.call(t)))return e;if(!n&&"function"==typeof(r=t.toString)&&!i(e=r.call(t)))return e;throw TypeError("Can't convert object to primitive value")}},function(t,n,r){var d=r(6),y=r(19),g=r(93),b=r(13),x=r(9),m="prototype",S=function(t,n,r){var e,i,o,u=t&S.F,c=t&S.G,f=t&S.S,a=t&S.P,s=t&S.B,l=t&S.W,h=c?y:y[n]||(y[n]={}),v=h[m],p=c?d:f?d[n]:(d[n]||{})[m];for(e in c&&(r=n),r)(i=!u&&p&&void 0!==p[e])&&x(h,e)||(o=i?p[e]:r[e],h[e]=c&&"function"!=typeof p[e]?r[e]:s&&i?g(o,d):l&&p[e]==o?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t[m]=e[m],t}(o):a&&"function"==typeof o?g(Function.call,o):o,a&&((h.virtual||(h.virtual={}))[e]=o,t&S.R&&v&&!v[e]&&b(v,e,o)))};S.F=1,S.G=2,S.S=4,S.P=8,S.B=16,S.W=32,S.U=64,S.R=128,t.exports=S},function(t,n,r){var e=r(34);t.exports=function(t){return Object(e(t))}},function(t,n,r){var o=r(196),e=r(1),i=r(118)("metadata"),u=i.store||(i.store=new(r(200))),c=function(t,n,r){var e=u.get(t);if(!e){if(!r)return;u.set(t,e=new o)}var i=e.get(n);if(!i){if(!r)return;e.set(n,i=new o)}return i};t.exports={store:u,map:c,has:function(t,n,r){var e=c(n,r,!1);return void 0!==e&&e.has(t)},get:function(t,n,r){var e=c(n,r,!1);return void 0===e?void 0:e.get(t)},set:function(t,n,r,e){c(r,e,!0).set(t,n)},keys:function(t,n){var r=c(t,n,!1),e=[];return r&&r.forEach(function(t,n){e.push(n)}),e},key:function(t){return void 0===t||"symbol"==typeof t?t:String(t)},exp:function(t){e(e.S,"Reflect",t)}}},function(t,n,r){"use strict";if(r(10)){var g=r(68),b=r(3),x=r(4),m=r(1),S=r(132),e=r(159),h=r(47),w=r(70),i=r(75),_=r(26),o=r(76),u=r(49),O=r(8),E=r(194),c=r(78),f=r(53),a=r(30),M=r(81),P=r(5),v=r(17),p=r(145),j=r(72),F=r(32),A=r(73).f,d=r(161),s=r(79),l=r(7),y=r(50),I=r(120),L=r(119),N=r(162),T=r(82),k=r(125),R=r(77),C=r(137),D=r(166),G=r(11),W=r(31),U=G.f,V=W.f,B=b.RangeError,q=b.TypeError,z=b.Uint8Array,K="ArrayBuffer",H="Shared"+K,J="BYTES_PER_ELEMENT",$="prototype",Y=Array[$],X=e.ArrayBuffer,Q=e.DataView,Z=y(0),tt=y(2),nt=y(3),rt=y(4),et=y(5),it=y(6),ot=I(!0),ut=I(!1),ct=N.values,ft=N.keys,at=N.entries,st=Y.lastIndexOf,lt=Y.reduce,ht=Y.reduceRight,vt=Y.join,pt=Y.sort,dt=Y.slice,yt=Y.toString,gt=Y.toLocaleString,bt=l("iterator"),xt=l("toStringTag"),mt=s("typed_constructor"),St=s("def_constructor"),wt=S.CONSTR,_t=S.TYPED,Ot=S.VIEW,Et="Wrong length!",Mt=y(1,function(t,n){return It(L(t,t[St]),n)}),Pt=x(function(){return 1===new z(new Uint16Array([1]).buffer)[0]}),jt=!!z&&!!z[$].set&&x(function(){new z(1).set({})}),Ft=function(t,n){var r=u(t);if(r<0||r%n)throw B("Wrong offset!");return r},At=function(t){if(P(t)&&_t in t)return t;throw q(t+" is not a typed array!")},It=function(t,n){if(!(P(t)&&mt in t))throw q("It is not a typed array constructor!");return new t(n)},Lt=function(t,n){return Nt(L(t,t[St]),n)},Nt=function(t,n){for(var r=0,e=n.length,i=It(t,e);r<e;)i[r]=n[r++];return i},Tt=function(t,n,r){U(t,n,{get:function(){return this._d[r]}})},kt=function(t){var n,r,e,i,o,u,c=v(t),f=arguments.length,a=1<f?arguments[1]:void 0,s=void 0!==a,l=d(c);if(null!=l&&!p(l)){for(u=l.call(c),e=[],n=0;!(o=u.next()).done;n++)e.push(o.value);c=e}for(s&&2<f&&(a=h(a,arguments[2],2)),n=0,r=O(c.length),i=It(this,r);n<r;n++)i[n]=s?a(c[n],n):c[n];return i},Rt=function(){for(var t=0,n=arguments.length,r=It(this,n);t<n;)r[t]=arguments[t++];return r},Ct=!!z&&x(function(){gt.call(new z(1))}),Dt=function(){return gt.apply(Ct?dt.call(At(this)):At(this),arguments)},Gt={copyWithin:function(t,n){return D.call(At(this),t,n,2<arguments.length?arguments[2]:void 0)},every:function(t){return rt(At(this),t,1<arguments.length?arguments[1]:void 0)},fill:function(t){return C.apply(At(this),arguments)},filter:function(t){return Lt(this,tt(At(this),t,1<arguments.length?arguments[1]:void 0))},find:function(t){return et(At(this),t,1<arguments.length?arguments[1]:void 0)},findIndex:function(t){return it(At(this),t,1<arguments.length?arguments[1]:void 0)},forEach:function(t){Z(At(this),t,1<arguments.length?arguments[1]:void 0)},indexOf:function(t){return ut(At(this),t,1<arguments.length?arguments[1]:void 0)},includes:function(t){return ot(At(this),t,1<arguments.length?arguments[1]:void 0)},join:function(t){return vt.apply(At(this),arguments)},lastIndexOf:function(t){return st.apply(At(this),arguments)},map:function(t){return Mt(At(this),t,1<arguments.length?arguments[1]:void 0)},reduce:function(t){return lt.apply(At(this),arguments)},reduceRight:function(t){return ht.apply(At(this),arguments)},reverse:function(){for(var t,n=this,r=At(n).length,e=Math.floor(r/2),i=0;i<e;)t=n[i],n[i++]=n[--r],n[r]=t;return n},some:function(t){return nt(At(this),t,1<arguments.length?arguments[1]:void 0)},sort:function(t){return pt.call(At(this),t)},subarray:function(t,n){var r=At(this),e=r.length,i=c(t,e);return new(L(r,r[St]))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,O((void 0===n?e:c(n,e))-i))}},Wt=function(t,n){return Lt(this,dt.call(At(this),t,n))},Ut=function(t){At(this);var n=Ft(arguments[1],1),r=this.length,e=v(t),i=O(e.length),o=0;if(r<i+n)throw B(Et);for(;o<i;)this[n+o]=e[o++]},Vt={entries:function(){return at.call(At(this))},keys:function(){return ft.call(At(this))},values:function(){return ct.call(At(this))}},Bt=function(t,n){return P(t)&&t[_t]&&"symbol"!=typeof n&&n in t&&String(+n)==String(n)},qt=function(t,n){return Bt(t,n=f(n,!0))?i(2,t[n]):V(t,n)},zt=function(t,n,r){return!(Bt(t,n=f(n,!0))&&P(r)&&a(r,"value"))||a(r,"get")||a(r,"set")||r.configurable||a(r,"writable")&&!r.writable||a(r,"enumerable")&&!r.enumerable?U(t,n,r):(t[n]=r.value,t)};wt||(W.f=qt,G.f=zt),m(m.S+m.F*!wt,"Object",{getOwnPropertyDescriptor:qt,defineProperty:zt}),x(function(){yt.call({})})&&(yt=gt=function(){return vt.call(this)});var Kt=o({},Gt);o(Kt,Vt),_(Kt,bt,Vt.values),o(Kt,{slice:Wt,set:Ut,constructor:function(){},toString:yt,toLocaleString:Dt}),Tt(Kt,"buffer","b"),Tt(Kt,"byteOffset","o"),Tt(Kt,"byteLength","l"),Tt(Kt,"length","e"),U(Kt,xt,{get:function(){return this[_t]}}),t.exports=function(t,l,n,o){var h=t+((o=!!o)?"Clamped":"")+"Array",r="get"+t,u="set"+t,v=b[h],c=v||{},e=v&&F(v),i=!v||!S.ABV,f={},a=v&&v[$],p=function(t,i){U(t,i,{get:function(){return t=i,(n=this._d).v[r](t*l+n.o,Pt);var t,n},set:function(t){return n=i,r=t,e=this._d,o&&(r=(r=Math.round(r))<0?0:255<r?255:255&r),void e.v[u](n*l+e.o,r,Pt);var n,r,e},enumerable:!0})};i?(v=n(function(t,n,r,e){w(t,v,h,"_d");var i,o,u,c,f=0,a=0;if(P(n)){if(!(n instanceof X||(c=M(n))==K||c==H))return _t in n?Nt(v,n):kt.call(v,n);i=n,a=Ft(r,l);var s=n.byteLength;if(void 0===e){if(s%l)throw B(Et);if((o=s-a)<0)throw B(Et)}else if(s<(o=O(e)*l)+a)throw B(Et);u=o/l}else u=E(n),i=new X(o=u*l);for(_(t,"_d",{b:i,o:a,l:o,e:u,v:new Q(i)});f<u;)p(t,f++)}),a=v[$]=j(Kt),_(a,"constructor",v)):x(function(){v(1)})&&x(function(){new v(-1)})&&k(function(t){new v,new v(null),new v(1.5),new v(t)},!0)||(v=n(function(t,n,r,e){var i;return w(t,v,h),P(n)?n instanceof X||(i=M(n))==K||i==H?void 0!==e?new c(n,Ft(r,l),e):void 0!==r?new c(n,Ft(r,l)):new c(n):_t in n?Nt(v,n):kt.call(v,n):new c(E(n))}),Z(e!==Function.prototype?A(c).concat(A(e)):A(c),function(t){t in v||_(v,t,c[t])}),v[$]=a,g||(a.constructor=v));var s=a[bt],d=!!s&&("values"==s.name||null==s.name),y=Vt.values;_(v,mt,!0),_(a,_t,h),_(a,Ot,!0),_(a,St,v),(o?new v(1)[xt]==h:xt in a)||U(a,xt,{get:function(){return h}}),f[h]=v,m(m.G+m.W+m.F*(v!=c),f),m(m.S,h,{BYTES_PER_ELEMENT:l}),m(m.S+m.F*x(function(){c.of.call(v,1)}),h,{from:kt,of:Rt}),J in a||_(a,J,l),m(m.P,h,Gt),R(h),m(m.P+m.F*jt,h,{set:Ut}),m(m.P+m.F*!d,h,Vt),g||a.toString==yt||(a.toString=yt),m(m.P+m.F*x(function(){new v(1).slice()}),h,{slice:Wt}),m(m.P+m.F*(x(function(){return[1,2].toLocaleString()!=new v([1,2]).toLocaleString()})||!x(function(){a.toLocaleString.call([1,2])})),h,{toLocaleString:Dt}),T[h]=d?s:y,g||d||_(a,bt,y)}}else t.exports=function(){}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(18),i=r(6).document,o=e(i)&&e(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,n,r){t.exports=!r(12)&&!r(20)(function(){return 7!=Object.defineProperty(r(59)("div"),"a",{get:function(){return 7}}).a})},function(t,n,r){"use strict";var x=r(23),m=r(54),S=r(66),w=r(13),_=r(36),O=r(98),E=r(38),M=r(104),P=r(16)("iterator"),j=!([].keys&&"next"in[].keys()),F="values",A=function(){return this};t.exports=function(t,n,r,e,i,o,u){O(r,n,e);var c,f,a,s=function(t){if(!j&&t in p)return p[t];switch(t){case"keys":case F:return function(){return new r(this,t)}}return function(){return new r(this,t)}},l=n+" Iterator",h=i==F,v=!1,p=t.prototype,d=p[P]||p["@@iterator"]||i&&p[i],y=d||s(i),g=i?h?s("entries"):y:void 0,b="Array"==n&&p.entries||d;if(b&&((a=M(b.call(new t)))!==Object.prototype&&a.next&&(E(a,l,!0),x||"function"==typeof a[P]||w(a,P,A))),h&&d&&d.name!==F&&(v=!0,y=function(){return d.call(this)}),x&&!u||!j&&!v&&p[P]||w(p,P,y),_[n]=y,_[l]=A,i)if(c={values:h?y:s(F),keys:o?y:s("keys"),entries:g},u)for(f in c)f in p||S(p,f,c[f]);else m(m.P+m.F*(j||v),n,c);return c}},function(t,n,e){var i=e(22),o=e(101),u=e(35),c=e(39)("IE_PROTO"),f=function(){},a="prototype",s=function(){var t,n=e(59)("iframe"),r=u.length;for(n.style.display="none",e(95).appendChild(n),n.src="javascript:",(t=n.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s[a][u[r]];return s()};t.exports=Object.create||function(t,n){var r;return null!==t?(f[a]=i(t),r=new f,f[a]=null,r[c]=t):r=s(),void 0===n?r:o(r,n)}},function(t,n,r){var e=r(65),i=r(35).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return e(t,i)}},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n,r){var u=r(9),c=r(15),f=r(92)(!1),a=r(39)("IE_PROTO");t.exports=function(t,n){var r,e=c(t),i=0,o=[];for(r in e)r!=a&&u(e,r)&&o.push(r);for(;n.length>i;)u(e,r=n[i++])&&(~f(o,r)||o.push(r));return o}},function(t,n,r){t.exports=r(13)},function(t,n,r){var e=r(7)("unscopables"),i=Array.prototype;null==i[e]&&r(26)(i,e,{}),t.exports=function(t){i[e][t]=!0}},function(t,n){t.exports=!1},function(t,n,r){var e=r(79)("meta"),i=r(5),o=r(30),u=r(11).f,c=0,f=Object.isExtensible||function(){return!0},a=!r(4)(function(){return f(Object.preventExtensions({}))}),s=function(t){u(t,e,{value:{i:"O"+ ++c,w:{}}})},l=t.exports={KEY:e,NEED:!1,fastKey:function(t,n){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,e)){if(!f(t))return"F";if(!n)return"E";s(t)}return t[e].i},getWeak:function(t,n){if(!o(t,e)){if(!f(t))return!0;if(!n)return!1;s(t)}return t[e].w},onFreeze:function(t){return a&&l.NEED&&f(t)&&!o(t,e)&&s(t),t}}},function(t,n){t.exports=function(t,n,r,e){if(!(t instanceof n)||void 0!==e&&e in t)throw TypeError(r+": incorrect invocation!");return t}},function(t,n,r){var h=r(47),v=r(177),p=r(145),d=r(2),y=r(8),g=r(161),b={},x={};(n=t.exports=function(t,n,r,e,i){var o,u,c,f,a=i?function(){return t}:g(t),s=h(r,e,n?2:1),l=0;if("function"!=typeof a)throw TypeError(t+" is not iterable!");if(p(a)){for(o=y(t.length);l<o;l++)if((f=n?s(d(u=t[l])[0],u[1]):s(t[l]))===b||f===x)return f}else for(c=a.call(t);!(u=c.next()).done;)if((f=v(c,s,u.value,n))===b||f===x)return f}).BREAK=b,n.RETURN=x},function(t,n,e){var i=e(2),o=e(183),u=e(141),c=e(154)("IE_PROTO"),f=function(){},a="prototype",s=function(){var t,n=e(140)("iframe"),r=u.length;for(n.style.display="none",e(143).appendChild(n),n.src="javascript:",(t=n.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),s=t.F;r--;)delete s[a][u[r]];return s()};t.exports=Object.create||function(t,n){var r;return null!==t?(f[a]=i(t),r=new f,f[a]=null,r[c]=t):r=s(),void 0===n?r:o(r,n)}},function(t,n,r){var e=r(185),i=r(141).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return e(t,i)}},function(t,n,r){var e=r(185),i=r(141);t.exports=Object.keys||function(t){return e(t,i)}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n,r){var i=r(27);t.exports=function(t,n,r){for(var e in n)i(t,e,n[e],r);return t}},function(t,n,r){"use strict";var e=r(3),i=r(11),o=r(10),u=r(7)("species");t.exports=function(t){var n=e[t];o&&n&&!n[u]&&i.f(n,u,{configurable:!0,get:function(){return this}})}},function(t,n,r){var e=r(49),i=Math.max,o=Math.min;t.exports=function(t,n){return(t=e(t))<0?i(t+n,0):o(t,n)}},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+e).toString(36))}},function(t,n,r){var e=r(5);t.exports=function(t,n){if(!e(t)||t._t!==n)throw TypeError("Incompatible receiver, "+n+" required!");return t}},function(t,n,r){var i=r(45),o=r(7)("toStringTag"),u="Arguments"==i(function(){return arguments}());t.exports=function(t){var n,r,e;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,n){try{return t[n]}catch(t){}}(n=Object(t),o))?r:u?i(n):"Object"==(e=i(n))&&"function"==typeof n.callee?"Arguments":e}},function(t,n){t.exports={}},function(t,n,r){var e=r(11).f,i=r(30),o=r(7)("toStringTag");t.exports=function(t,n,r){t&&!i(t=r?t:t.prototype,o)&&e(t,o,{configurable:!0,value:n})}},function(t,n,r){var u=r(1),e=r(51),c=r(4),f=r(157),i="["+f+"]",o=RegExp("^"+i+i+"*"),a=RegExp(i+i+"*$"),s=function(t,n,r){var e={},i=c(function(){return!!f[t]()||"​"!="​"[t]()}),o=e[t]=i?n(l):f[t];r&&(e[r]=o),u(u.P+u.F*i,"String",e)},l=s.trim=function(t,n){return t=String(e(t)),1&n&&(t=t.replace(o,"")),2&n&&(t=t.replace(a,"")),t};t.exports=s},function(t,n,r){t.exports={default:r(88),__esModule:!0}},function(t,n,r){t.exports={default:r(89),__esModule:!0}},function(t,n,r){"use strict";function e(t){return t&&t.__esModule?t:{default:t}}n.__esModule=!0;var i=e(r(86)),o=e(r(85)),u="function"==typeof o.default&&"symbol"==typeof i.default?function(t){return typeof t}:function(t){return t&&"function"==typeof o.default&&t.constructor===o.default&&t!==o.default.prototype?"symbol":typeof t};n.default="function"==typeof o.default&&"symbol"===u(i.default)?function(t){return void 0===t?"undefined":u(t)}:function(t){return t&&"function"==typeof o.default&&t.constructor===o.default&&t!==o.default.prototype?"symbol":void 0===t?"undefined":u(t)}},function(t,n,r){r(111),r(109),r(112),r(113),t.exports=r(19).Symbol},function(t,n,r){r(110),r(114),t.exports=r(44).f("iterator")},function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,n){t.exports=function(){}},function(t,n,r){var f=r(15),a=r(107),s=r(106);t.exports=function(c){return function(t,n,r){var e,i=f(t),o=a(i.length),u=s(r,o);if(c&&n!=n){for(;u<o;)if((e=i[u++])!=e)return!0}else for(;u<o;u++)if((c||u in i)&&i[u]===n)return c||u||0;return!c&&-1}}},function(t,n,r){var o=r(90);t.exports=function(e,i,t){if(o(e),void 0===i)return e;switch(t){case 1:return function(t){return e.call(i,t)};case 2:return function(t,n){return e.call(i,t,n)};case 3:return function(t,n,r){return e.call(i,t,n,r)}}return function(){return e.apply(i,arguments)}}},function(t,n,r){var c=r(29),f=r(64),a=r(37);t.exports=function(t){var n=c(t),r=f.f;if(r)for(var e,i=r(t),o=a.f,u=0;i.length>u;)o.call(t,e=i[u++])&&n.push(e);return n}},function(t,n,r){var e=r(6).document;t.exports=e&&e.documentElement},function(t,n,r){var e=r(58);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},function(t,n,r){var e=r(58);t.exports=Array.isArray||function(t){return"Array"==e(t)}},function(t,n,r){"use strict";var e=r(62),i=r(24),o=r(38),u={};r(13)(u,r(16)("iterator"),function(){return this}),t.exports=function(t,n,r){t.prototype=e(u,{next:i(1,r)}),o(t,n+" Iterator")}},function(t,n){t.exports=function(t,n){return{value:n,done:!!t}}},function(t,n,r){var e=r(25)("meta"),i=r(18),o=r(9),u=r(14).f,c=0,f=Object.isExtensible||function(){return!0},a=!r(20)(function(){return f(Object.preventExtensions({}))}),s=function(t){u(t,e,{value:{i:"O"+ ++c,w:{}}})},l=t.exports={KEY:e,NEED:!1,fastKey:function(t,n){if(!i(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,e)){if(!f(t))return"F";if(!n)return"E";s(t)}return t[e].i},getWeak:function(t,n){if(!o(t,e)){if(!f(t))return!0;if(!n)return!1;s(t)}return t[e].w},onFreeze:function(t){return a&&l.NEED&&f(t)&&!o(t,e)&&s(t),t}}},function(t,n,r){var u=r(14),c=r(22),f=r(29);t.exports=r(12)?Object.defineProperties:function(t,n){c(t);for(var r,e=f(n),i=e.length,o=0;o<i;)u.f(t,r=e[o++],n[r]);return t}},function(t,n,r){var e=r(37),i=r(24),o=r(15),u=r(42),c=r(9),f=r(60),a=Object.getOwnPropertyDescriptor;n.f=r(12)?a:function(t,n){if(t=o(t),n=u(n,!0),f)try{return a(t,n)}catch(t){}if(c(t,n))return i(!e.f.call(t,n),t[n])}},function(t,n,r){var e=r(15),i=r(63).f,o={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return u&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return u.slice()}}(t):i(e(t))}},function(t,n,r){var e=r(9),i=r(55),o=r(39)("IE_PROTO"),u=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=i(t),e(t,o)?t[o]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},function(t,n,r){var f=r(41),a=r(34);t.exports=function(c){return function(t,n){var r,e,i=String(a(t)),o=f(n),u=i.length;return o<0||u<=o?c?"":void 0:(r=i.charCodeAt(o))<55296||56319<r||o+1===u||(e=i.charCodeAt(o+1))<56320||57343<e?c?i.charAt(o):r:c?i.slice(o,o+2):e-56320+(r-55296<<10)+65536}}},function(t,n,r){var e=r(41),i=Math.max,o=Math.min;t.exports=function(t,n){return(t=e(t))<0?i(t+n,0):o(t,n)}},function(t,n,r){var e=r(41),i=Math.min;t.exports=function(t){return 0<t?i(e(t),9007199254740991):0}},function(t,n,r){"use strict";var e=r(91),i=r(99),o=r(36),u=r(15);t.exports=r(61)(Array,"Array",function(t,n){this._t=u(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,i(1)):i(0,"keys"==n?r:"values"==n?t[r]:[r,t[r]])},"values"),o.Arguments=o.Array,e("keys"),e("values"),e("entries")},function(t,n){},function(t,n,r){"use strict";var e=r(105)(!0);r(61)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,n=this._t,r=this._i;return r>=n.length?{value:void 0,done:!0}:(t=e(n,r),this._i+=t.length,{value:t,done:!1})})},function(t,n,r){"use strict";var e=r(6),u=r(9),i=r(12),o=r(54),c=r(66),f=r(100).KEY,a=r(20),s=r(40),l=r(38),h=r(25),v=r(16),p=r(44),d=r(43),y=r(94),g=r(97),b=r(22),x=r(18),m=r(55),S=r(15),w=r(42),_=r(24),O=r(62),E=r(103),M=r(102),P=r(64),j=r(14),F=r(29),A=M.f,I=j.f,L=E.f,N=e.Symbol,T=e.JSON,k=T&&T.stringify,R="prototype",C=v("_hidden"),D=v("toPrimitive"),G={}.propertyIsEnumerable,W=s("symbol-registry"),U=s("symbols"),V=s("op-symbols"),B=Object[R],q="function"==typeof N&&!!P.f,z=e.QObject,K=!z||!z[R]||!z[R].findChild,H=i&&a(function(){return 7!=O(I({},"a",{get:function(){return I(this,"a",{value:7}).a}})).a})?function(t,n,r){var e=A(B,n);e&&delete B[n],I(t,n,r),e&&t!==B&&I(B,n,e)}:I,J=function(t){var n=U[t]=O(N[R]);return n._k=t,n},$=q&&"symbol"==typeof N.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof N},Y=function(t,n,r){return t===B&&Y(V,n,r),b(t),n=w(n,!0),b(r),u(U,n)?(r.enumerable?(u(t,C)&&t[C][n]&&(t[C][n]=!1),r=O(r,{enumerable:_(0,!1)})):(u(t,C)||I(t,C,_(1,{})),t[C][n]=!0),H(t,n,r)):I(t,n,r)},X=function(t,n){b(t);for(var r,e=y(n=S(n)),i=0,o=e.length;i<o;)Y(t,r=e[i++],n[r]);return t},Q=function(t){var n=G.call(this,t=w(t,!0));return!(this===B&&u(U,t)&&!u(V,t))&&(!(n||!u(this,t)||!u(U,t)||u(this,C)&&this[C][t])||n)},Z=function(t,n){if(t=S(t),n=w(n,!0),t!==B||!u(U,n)||u(V,n)){var r=A(t,n);return!r||!u(U,n)||u(t,C)&&t[C][n]||(r.enumerable=!0),r}},tt=function(t){for(var n,r=L(S(t)),e=[],i=0;r.length>i;)u(U,n=r[i++])||n==C||n==f||e.push(n);return e},nt=function(t){for(var n,r=t===B,e=L(r?V:S(t)),i=[],o=0;e.length>o;)!u(U,n=e[o++])||r&&!u(B,n)||i.push(U[n]);return i};q||(c((N=function(){if(this instanceof N)throw TypeError("Symbol is not a constructor!");var n=h(0<arguments.length?arguments[0]:void 0),r=function(t){this===B&&r.call(V,t),u(this,C)&&u(this[C],n)&&(this[C][n]=!1),H(this,n,_(1,t))};return i&&K&&H(B,n,{configurable:!0,set:r}),J(n)})[R],"toString",function(){return this._k}),M.f=Z,j.f=Y,r(63).f=E.f=tt,r(37).f=Q,P.f=nt,i&&!r(23)&&c(B,"propertyIsEnumerable",Q,!0),p.f=function(t){return J(v(t))}),o(o.G+o.W+o.F*!q,{Symbol:N});for(var rt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),et=0;rt.length>et;)v(rt[et++]);for(var it=F(v.store),ot=0;it.length>ot;)d(it[ot++]);o(o.S+o.F*!q,"Symbol",{for:function(t){return u(W,t+="")?W[t]:W[t]=N(t)},keyFor:function(t){if(!$(t))throw TypeError(t+" is not a symbol!");for(var n in W)if(W[n]===t)return n},useSetter:function(){K=!0},useSimple:function(){K=!1}}),o(o.S+o.F*!q,"Object",{create:function(t,n){return void 0===n?O(t):X(O(t),n)},defineProperty:Y,defineProperties:X,getOwnPropertyDescriptor:Z,getOwnPropertyNames:tt,getOwnPropertySymbols:nt});var ut=a(function(){P.f(1)});o(o.S+o.F*ut,"Object",{getOwnPropertySymbols:function(t){return P.f(m(t))}}),T&&o(o.S+o.F*(!q||a(function(){var t=N();return"[null]"!=k([t])||"{}"!=k({a:t})||"{}"!=k(Object(t))})),"JSON",{stringify:function(t){for(var n,r,e=[t],i=1;arguments.length>i;)e.push(arguments[i++]);if(r=n=e[1],(x(n)||void 0!==t)&&!$(t))return g(n)||(n=function(t,n){if("function"==typeof r&&(n=r.call(this,t,n)),!$(n))return n}),e[1]=n,k.apply(T,e)}}),N[R][D]||r(13)(N[R],D,N[R].valueOf),l(N,"Symbol"),l(Math,"Math",!0),l(e.JSON,"JSON",!0)},function(t,n,r){r(43)("asyncIterator")},function(t,n,r){r(43)("observable")},function(t,n,r){r(108);for(var e=r(6),i=r(13),o=r(36),u=r(16)("toStringTag"),c="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),f=0;f<c.length;f++){var a=c[f],s=e[a],l=s&&s.prototype;l&&!l[u]&&i(l,u,a),o[a]=o.Array}},function(t,n,r){"use strict";var e=r(2);t.exports=function(){var t=e(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},function(t,n,r){var e=r(45);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==e(t)?t.split(""):Object(t)}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,r){var e=r(46),i=r(3),o="__core-js_shared__",u=i[o]||(i[o]={});(t.exports=function(t,n){return u[t]||(u[t]=void 0!==n?n:{})})("versions",[]).push({version:e.version,mode:r(68)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,n,r){var i=r(2),o=r(21),u=r(7)("species");t.exports=function(t,n){var r,e=i(t).constructor;return void 0===e||null==(r=i(e)[u])?n:o(r)}},function(t,n,r){var f=r(33),a=r(8),s=r(78);t.exports=function(c){return function(t,n,r){var e,i=f(t),o=a(i.length),u=s(r,o);if(c&&n!=n){for(;u<o;)if((e=i[u++])!=e)return!0}else for(;u<o;u++)if((c||u in i)&&i[u]===n)return c||u||0;return!c&&-1}}},function(t,n,r){"use strict";var g=r(3),b=r(1),x=r(27),m=r(76),S=r(69),w=r(71),_=r(70),O=r(5),E=r(4),M=r(125),P=r(83),j=r(144);t.exports=function(e,t,n,r,i,o){var u=g[e],c=u,f=i?"set":"add",a=c&&c.prototype,s={},l=function(t){var r=a[t];x(a,t,"delete"==t?function(t){return!(o&&!O(t))&&r.call(this,0===t?0:t)}:"has"==t?function(t){return!(o&&!O(t))&&r.call(this,0===t?0:t)}:"get"==t?function(t){return o&&!O(t)?void 0:r.call(this,0===t?0:t)}:"add"==t?function(t){return r.call(this,0===t?0:t),this}:function(t,n){return r.call(this,0===t?0:t,n),this})};if("function"==typeof c&&(o||a.forEach&&!E(function(){(new c).entries().next()}))){var h=new c,v=h[f](o?{}:-0,1)!=h,p=E(function(){h.has(1)}),d=M(function(t){new c(t)}),y=!o&&E(function(){for(var t=new c,n=5;n--;)t[f](n,n);return!t.has(-0)});d||(((c=t(function(t,n){_(t,c,e);var r=j(new u,t,c);return null!=n&&w(n,i,r[f],r),r})).prototype=a).constructor=c),(p||y)&&(l("delete"),l("has"),i&&l("get")),(y||v)&&l(f),o&&a.clear&&delete a.clear}else c=r.getConstructor(t,e,i,f),m(c.prototype,n),S.NEED=!0;return P(c,e),s[e]=c,b(b.G+b.W+b.F*(c!=u),s),o||r.setStrong(c,e,i),c}},function(t,n,r){"use strict";r(197);var s=r(27),l=r(26),h=r(4),v=r(51),p=r(7),d=r(152),y=p("species"),g=!h(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}),b=function(){var t=/(?:)/,n=t.exec;t.exec=function(){return n.apply(this,arguments)};var r="ab".split(t);return 2===r.length&&"a"===r[0]&&"b"===r[1]}();t.exports=function(r,t,n){var e=p(r),o=!h(function(){var t={};return t[e]=function(){return 7},7!=""[r](t)}),i=o?!h(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===r&&(n.constructor={},n.constructor[y]=function(){return n}),n[e](""),!t}):void 0;if(!o||!i||"replace"===r&&!g||"split"===r&&!b){var u=/./[e],c=n(v,e,""[r],function(t,n,r,e,i){return n.exec===d?o&&!i?{done:!0,value:u.call(n,r,e)}:{done:!0,value:t.call(r,n,e)}:{done:!1}}),f=c[0],a=c[1];s(String.prototype,r,f),l(RegExp.prototype,e,2==t?function(t,n){return a.call(t,this,n)}:function(t){return a.call(t,this)})}}},function(t,n,r){var e=r(45);t.exports=Array.isArray||function(t){return"Array"==e(t)}},function(t,n,r){var e=r(5),i=r(45),o=r(7)("match");t.exports=function(t){var n;return e(t)&&(void 0!==(n=t[o])?!!n:"RegExp"==i(t))}},function(t,n,r){var o=r(7)("iterator"),u=!1;try{var e=[7][o]();e.return=function(){u=!0},Array.from(e,function(){throw 2})}catch(t){}t.exports=function(t,n){if(!n&&!u)return!1;var r=!1;try{var e=[7],i=e[o]();i.next=function(){return{done:r=!0}},e[o]=function(){return i},t(e)}catch(t){}return r}},function(t,n,r){"use strict";t.exports=r(68)||!r(4)(function(){var t=Math.random();__defineSetter__.call(null,t,function(){}),delete r(3)[t]})},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n,r){"use strict";var i=r(81),o=RegExp.prototype.exec;t.exports=function(t,n){var r=t.exec;if("function"==typeof r){var e=r.call(t,n);if("object"!=typeof e)throw new TypeError("RegExp exec method returned something other than an Object or null");return e}if("RegExp"!==i(t))throw new TypeError("RegExp#exec called on incompatible receiver");return o.call(t,n)}},function(t,n,r){"use strict";var e=r(1),u=r(21),c=r(47),f=r(71);t.exports=function(t){e(e.S,t,{from:function(t){var n,r,e,i,o=arguments[1];return u(this),(n=void 0!==o)&&u(o),null==t?new this:(r=[],n?(e=0,i=c(o,arguments[2],2),f(t,!1,function(t){r.push(i(t,e++))})):f(t,!1,r.push,r),new this(r))}})}},function(t,n,r){"use strict";var e=r(1);t.exports=function(t){e(e.S,t,{of:function(){for(var t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return new this(n)}})}},function(t,n,r){var f=r(49),a=r(51);t.exports=function(c){return function(t,n){var r,e,i=String(a(t)),o=f(n),u=i.length;return o<0||u<=o?c?"":void 0:(r=i.charCodeAt(o))<55296||56319<r||o+1===u||(e=i.charCodeAt(o+1))<56320||57343<e?c?i.charAt(o):r:c?i.slice(o,o+2):e-56320+(r-55296<<10)+65536}}},function(t,n,r){for(var e,i=r(3),o=r(26),u=r(79),c=u("typed_array"),f=u("view"),a=!(!i.ArrayBuffer||!i.DataView),s=a,l=0,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");l<9;)(e=i[h[l++]])?(o(e.prototype,c,!0),o(e.prototype,f,!0)):s=!1;t.exports={ABV:a,CONSTR:s,TYPED:c,VIEW:f}},function(t,n,r){var e=r(3).navigator;t.exports=e&&e.userAgent||""},function(t,n){"use strict";var r,e={versions:(r=window.navigator.userAgent,{trident:-1<r.indexOf("Trident"),presto:-1<r.indexOf("Presto"),webKit:-1<r.indexOf("AppleWebKit"),gecko:-1<r.indexOf("Gecko")&&-1==r.indexOf("KHTML"),mobile:!!r.match(/AppleWebKit.*Mobile.*/),ios:!!r.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),android:-1<r.indexOf("Android")||-1<r.indexOf("Linux"),iPhone:-1<r.indexOf("iPhone")||-1<r.indexOf("Mac"),iPad:-1<r.indexOf("iPad"),webApp:-1==r.indexOf("Safari"),weixin:-1==r.indexOf("MicroMessenger")})};t.exports=e},function(t,n,r){"use strict";var e,i=r(87),l=(e=i)&&e.__esModule?e:{default:e},h=function(){function n(t,n,r){return n||r?String.fromCharCode(n||r):o[t]||t}function r(t){return s[t]}var e=/&quot;|&lt;|&gt;|&amp;|&nbsp;|&apos;|&#(\d+);|&#(\d+)/g,i=/['<> "&]/g,o={"&quot;":'"',"&lt;":"<","&gt;":">","&amp;":"&","&nbsp;":" "},u=/\u00a0/g,c=/<br\s*\/?>/gi,f=/\r?\n/g,a=/\s/g,s={};for(var t in o)s[o[t]]=t;return o["&apos;"]="'",s["'"]="&#39;",{encode:function(t){return t?(""+t).replace(i,r).replace(f,"<br/>").replace(a,"&nbsp;"):""},decode:function(t){return t?(""+t).replace(c,"\n").replace(e,n).replace(u," "):""},encodeBase16:function(t){if(!t)return t;for(var n=[],r=0,e=(t+="").length;r<e;r++)n.push(t.charCodeAt(r).toString(16).toUpperCase());return n.join("")},encodeBase16forJSON:function(t){if(!t)return t;for(var n=[],r=0,e=(t=t.replace(/[\u4E00-\u9FBF]/gi,function(t){return escape(t).replace("%u","\\u")})).length;r<e;r++)n.push(t.charCodeAt(r).toString(16).toUpperCase());return n.join("")},decodeBase16:function(t){if(!t)return t;for(var n=[],r=0,e=(t+="").length;r<e;r+=2)n.push(String.fromCharCode("0x"+t.slice(r,r+2)));return n.join("")},encodeObject:function(t){if(t instanceof Array)for(var n=0,r=t.length;n<r;n++)t[n]=h.encodeObject(t[n]);else if("object"==(void 0===t?"undefined":(0,l.default)(t)))for(var e in t)t[e]=h.encodeObject(t[e]);else if("string"==typeof t)return h.encode(t);return t},loadScript:function(t){var n=document.createElement("script");document.getElementsByTagName("body")[0].appendChild(n),n.setAttribute("src",t)},addLoadEvent:function(t){var n=window.onload;"function"!=typeof window.onload?window.onload=t:window.onload=function(){n(),t()}}}}();t.exports=h},function(t,n,r){"use strict";var e=r(131)(!0);t.exports=function(t,n,r){return n+(r?e(t,n).length:1)}},function(t,n,r){"use strict";var c=r(17),f=r(78),a=r(8);t.exports=function(t){for(var n=c(this),r=a(n.length),e=arguments.length,i=f(1<e?arguments[1]:void 0,r),o=2<e?arguments[2]:void 0,u=void 0===o?r:f(o,r);i<u;)n[i++]=t;return n}},function(t,n,r){var e=r(215);t.exports=function(t,n){return new(e(t))(n)}},function(t,n,r){"use strict";var e=r(11),i=r(75);t.exports=function(t,n,r){n in t?e.f(t,n,i(0,r)):t[n]=r}},function(t,n,r){var e=r(5),i=r(3).document,o=e(i)&&e(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,r){var e=r(7)("match");t.exports=function(n){var r=/./;try{"/./"[n](r)}catch(t){try{return r[e]=!1,!"/./"[n](r)}catch(n){}}return!0}},function(t,n,r){var e=r(3).document;t.exports=e&&e.documentElement},function(t,n,r){var o=r(5),u=r(153).set;t.exports=function(t,n,r){var e,i=n.constructor;return i!==r&&"function"==typeof i&&(e=i.prototype)!==r.prototype&&o(e)&&u&&u(t,e),t}},function(t,n,r){var e=r(82),i=r(7)("iterator"),o=Array.prototype;t.exports=function(t){return void 0!==t&&(e.Array===t||o[i]===t)}},function(t,n,r){"use strict";var e=r(72),i=r(75),o=r(83),u={};r(26)(u,r(7)("iterator"),function(){return this}),t.exports=function(t,n,r){t.prototype=e(u,{next:i(1,r)}),o(t,n+" Iterator")}},function(t,n,r){"use strict";var x=r(68),m=r(1),S=r(27),w=r(26),_=r(82),O=r(146),E=r(83),M=r(32),P=r(7)("iterator"),j=!([].keys&&"next"in[].keys()),F="values",A=function(){return this};t.exports=function(t,n,r,e,i,o,u){O(r,n,e);var c,f,a,s=function(t){if(!j&&t in p)return p[t];switch(t){case"keys":case F:return function(){return new r(this,t)}}return function(){return new r(this,t)}},l=n+" Iterator",h=i==F,v=!1,p=t.prototype,d=p[P]||p["@@iterator"]||i&&p[i],y=d||s(i),g=i?h?s("entries"):y:void 0,b="Array"==n&&p.entries||d;if(b&&((a=M(b.call(new t)))!==Object.prototype&&a.next&&(E(a,l,!0),x||"function"==typeof a[P]||w(a,P,A))),h&&d&&d.name!==F&&(v=!0,y=function(){return d.call(this)}),x&&!u||!j&&!v&&p[P]||w(p,P,y),_[n]=y,_[l]=A,i)if(c={values:h?y:s(F),keys:o?y:s("keys"),entries:g},u)for(f in c)f in p||S(p,f,c[f]);else m(m.P+m.F*(j||v),n,c);return c}},function(t,n){var r=Math.expm1;t.exports=!r||22025.465794806718<r(10)||r(10)<22025.465794806718||-2e-17!=r(-2e-17)?function(t){return 0==(t=+t)?t:-1e-6<t&&t<1e-6?t+t*t/2:Math.exp(t)-1}:r},function(t,n){t.exports=Math.sign||function(t){return 0==(t=+t)||t!=t?t:t<0?-1:1}},function(t,n,r){var c=r(3),f=r(158).set,a=c.MutationObserver||c.WebKitMutationObserver,s=c.process,l=c.Promise,h="process"==r(45)(s);t.exports=function(){var r,e,i,t=function(){var t,n;for(h&&(t=s.domain)&&t.exit();r;){n=r.fn,r=r.next;try{n()}catch(t){throw r?i():e=void 0,t}}e=void 0,t&&t.enter()};if(h)i=function(){s.nextTick(t)};else if(!a||c.navigator&&c.navigator.standalone)if(l&&l.resolve){var n=l.resolve(void 0);i=function(){n.then(t)}}else i=function(){f.call(c,t)};else{var o=!0,u=document.createTextNode("");new a(t).observe(u,{characterData:!0}),i=function(){u.data=o=!o}}return function(t){var n={fn:t,next:void 0};e&&(e.next=n),r||(r=n,i()),e=n}}},function(t,n,r){"use strict";function e(t){var r,e;this.promise=new t(function(t,n){if(void 0!==r||void 0!==e)throw TypeError("Bad Promise constructor");r=t,e=n}),this.resolve=i(r),this.reject=i(e)}var i=r(21);t.exports.f=function(t){return new e(t)}},function(t,n,r){"use strict";var e,i,u=r(115),c=RegExp.prototype.exec,f=String.prototype.replace,o=c,a="lastIndex",s=(e=/a/,i=/b*/g,c.call(e,"a"),c.call(i,"a"),0!==e[a]||0!==i[a]),l=void 0!==/()??/.exec("")[1];(s||l)&&(o=function(t){var n,r,e,i,o=this;return l&&(r=new RegExp("^"+o.source+"$(?!\\s)",u.call(o))),s&&(n=o[a]),e=c.call(o,t),s&&e&&(o[a]=o.global?e.index+e[0].length:n),l&&e&&1<e.length&&f.call(e[0],r,function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(e[i]=void 0)}),e}),t.exports=o},function(t,n,i){var r=i(5),e=i(2),o=function(t,n){if(e(t),!r(n)&&null!==n)throw TypeError(n+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,r,e){try{(e=i(47)(Function.call,i(31).f(Object.prototype,"__proto__").set,2))(t,[]),r=!(t instanceof Array)}catch(t){r=!0}return function(t,n){return o(t,n),r?t.__proto__=n:e(t,n),t}}({},!1):void 0),check:o}},function(t,n,r){var e=r(118)("keys"),i=r(79);t.exports=function(t){return e[t]||(e[t]=i(t))}},function(t,n,r){var e=r(124),i=r(51);t.exports=function(t,n,r){if(e(n))throw TypeError("String#"+r+" doesn't accept regex!");return String(i(t))}},function(t,n,r){"use strict";var i=r(49),o=r(51);t.exports=function(t){var n=String(o(this)),r="",e=i(t);if(e<0||e==1/0)throw RangeError("Count can't be negative");for(;0<e;(e>>>=1)&&(n+=n))1&e&&(r+=n);return r}},function(t,n){t.exports="\t\n\v\f\r   ᠎             　\u2028\u2029\ufeff"},function(t,n,r){var e,i,o,u=r(47),c=r(175),f=r(143),a=r(140),s=r(3),l=s.process,h=s.setImmediate,v=s.clearImmediate,p=s.MessageChannel,d=s.Dispatch,y=0,g={},b="onreadystatechange",x=function(){var t=+this;if(g.hasOwnProperty(t)){var n=g[t];delete g[t],n()}},m=function(t){x.call(t.data)};h&&v||(h=function(t){for(var n=[],r=1;arguments.length>r;)n.push(arguments[r++]);return g[++y]=function(){c("function"==typeof t?t:Function(t),n)},e(y),y},v=function(t){delete g[t]},"process"==r(45)(l)?e=function(t){l.nextTick(u(x,t,1))}:d&&d.now?e=function(t){d.now(u(x,t,1))}:p?(o=(i=new p).port2,i.port1.onmessage=m,e=u(o.postMessage,o,1)):s.addEventListener&&"function"==typeof postMessage&&!s.importScripts?(e=function(t){s.postMessage(t+"","*")},s.addEventListener("message",m,!1)):e=b in a("script")?function(t){f.appendChild(a("script"))[b]=function(){f.removeChild(this),x.call(t)}}:function(t){setTimeout(u(x,t,1),0)}),t.exports={set:h,clear:v}},function(t,n,r){"use strict";function e(t,n,r){var e,i,o,u=new Array(r),c=8*r-n-1,f=(1<<c)-1,a=f>>1,s=23===n?W(2,-24)-W(2,-77):0,l=0,h=t<0||0===t&&1/t<0?1:0;for((t=G(t))!=t||t===C?(i=t!=t?1:0,e=f):(e=U(V(t)/B),t*(o=W(2,-e))<1&&(e--,o*=2),2<=(t+=1<=e+a?s/o:s*W(2,1-a))*o&&(e++,o/=2),f<=e+a?(i=0,e=f):1<=e+a?(i=(t*o-1)*W(2,n),e+=a):(i=t*W(2,a-1)*W(2,n),e=0));8<=n;u[l++]=255&i,i/=256,n-=8);for(e=e<<n|i,c+=n;0<c;u[l++]=255&e,e/=256,c-=8);return u[--l]|=128*h,u}function i(t,n,r){var e,i=8*r-n-1,o=(1<<i)-1,u=o>>1,c=i-7,f=r-1,a=t[f--],s=127&a;for(a>>=7;0<c;s=256*s+t[f],f--,c-=8);for(e=s&(1<<-c)-1,s>>=-c,c+=n;0<c;e=256*e+t[f],f--,c-=8);if(0===s)s=1-u;else{if(s===o)return e?NaN:a?-C:C;e+=W(2,n),s-=u}return(a?-1:1)*e*W(2,s-n)}function o(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]}function u(t){return[255&t]}function c(t){return[255&t,t>>8&255]}function f(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]}function a(t){return e(t,52,8)}function s(t){return e(t,23,4)}function l(t,n,r){M(t[I],n,{get:function(){return this[r]}})}function h(t,n,r,e){var i=O(+r);if(i+n>t[H])throw R(L);var o=t[K]._b,u=i+t[J],c=o.slice(u,u+n);return e?c:c.reverse()}function v(t,n,r,e,i,o){var u=O(+r);if(u+n>t[H])throw R(L);for(var c=t[K]._b,f=u+t[J],a=e(+i),s=0;s<n;s++)c[f+s]=a[o?s:n-s-1]}var p=r(3),d=r(10),y=r(68),g=r(132),b=r(26),x=r(76),m=r(4),S=r(70),w=r(49),_=r(8),O=r(194),E=r(73).f,M=r(11).f,P=r(137),j=r(83),F="ArrayBuffer",A="DataView",I="prototype",L="Wrong index!",N=p[F],T=p[A],k=p.Math,R=p.RangeError,C=p.Infinity,D=N,G=k.abs,W=k.pow,U=k.floor,V=k.log,B=k.LN2,q="byteLength",z="byteOffset",K=d?"_b":"buffer",H=d?"_l":q,J=d?"_o":z;if(g.ABV){if(!m(function(){N(1)})||!m(function(){new N(-1)})||m(function(){return new N,new N(1.5),new N(NaN),N.name!=F})){for(var $,Y=(N=function(t){return S(this,N),new D(O(t))})[I]=D[I],X=E(D),Q=0;X.length>Q;)($=X[Q++])in N||b(N,$,D[$]);y||(Y.constructor=N)}var Z=new T(new N(2)),tt=T[I].setInt8;Z.setInt8(0,2147483648),Z.setInt8(1,2147483649),!Z.getInt8(0)&&Z.getInt8(1)||x(T[I],{setInt8:function(t,n){tt.call(this,t,n<<24>>24)},setUint8:function(t,n){tt.call(this,t,n<<24>>24)}},!0)}else N=function(t){S(this,N,F);var n=O(t);this._b=P.call(new Array(n),0),this[H]=n},T=function(t,n,r){S(this,T,A),S(t,N,A);var e=t[H],i=w(n);if(i<0||e<i)throw R("Wrong offset!");if(e<i+(r=void 0===r?e-i:_(r)))throw R("Wrong length!");this[K]=t,this[J]=i,this[H]=r},d&&(l(N,q,"_l"),l(T,"buffer","_b"),l(T,q,"_l"),l(T,z,"_o")),x(T[I],{getInt8:function(t){return h(this,1,t)[0]<<24>>24},getUint8:function(t){return h(this,1,t)[0]},getInt16:function(t){var n=h(this,2,t,arguments[1]);return(n[1]<<8|n[0])<<16>>16},getUint16:function(t){var n=h(this,2,t,arguments[1]);return n[1]<<8|n[0]},getInt32:function(t){return o(h(this,4,t,arguments[1]))},getUint32:function(t){return o(h(this,4,t,arguments[1]))>>>0},getFloat32:function(t){return i(h(this,4,t,arguments[1]),23,4)},getFloat64:function(t){return i(h(this,8,t,arguments[1]),52,8)},setInt8:function(t,n){v(this,1,t,u,n)},setUint8:function(t,n){v(this,1,t,u,n)},setInt16:function(t,n){v(this,2,t,c,n,arguments[2])},setUint16:function(t,n){v(this,2,t,c,n,arguments[2])},setInt32:function(t,n){v(this,4,t,f,n,arguments[2])},setUint32:function(t,n){v(this,4,t,f,n,arguments[2])},setFloat32:function(t,n){v(this,4,t,s,n,arguments[2])},setFloat64:function(t,n){v(this,8,t,a,n,arguments[2])}});j(N,F),j(T,A),b(T[I],g.VIEW,!0),n[F]=N,n[A]=T},function(t,n,r){var e=r(3),i=r(46),o=r(68),u=r(195),c=r(11).f;t.exports=function(t){var n=i.Symbol||(i.Symbol=o?{}:e.Symbol||{});"_"==t.charAt(0)||t in n||c(n,t,{value:u.f(t)})}},function(t,n,r){var e=r(81),i=r(7)("iterator"),o=r(82);t.exports=r(46).getIteratorMethod=function(t){if(null!=t)return t[i]||t["@@iterator"]||o[e(t)]}},function(t,n,r){"use strict";var e=r(67),i=r(178),o=r(82),u=r(33);t.exports=r(147)(Array,"Array",function(t,n){this._t=u(t),this._i=0,this._k=n},function(){var t=this._t,n=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,i(1)):i(0,"keys"==n?r:"values"==n?t[r]:[r,t[r]])},"values"),o.Arguments=o.Array,e("keys"),e("values"),e("entries")},function(t,n){t.exports=function(t,n){t.classList?t.classList.add(n):t.className+=" "+n}},function(t,n){t.exports=function(t,n){if(t.classList)t.classList.remove(n);else{var r=new RegExp("(^|\\b)"+n.split(" ").join("|")+"(\\b|$)","gi");t.className=t.className.replace(r," ")}}},function(t,n,r){var e=r(45);t.exports=function(t,n){if("number"!=typeof t&&"Number"!=e(t))throw TypeError(n);return+t}},function(t,n,r){"use strict";var a=r(17),s=r(78),l=r(8);t.exports=[].copyWithin||function(t,n){var r=a(this),e=l(r.length),i=s(t,e),o=s(n,e),u=2<arguments.length?arguments[2]:void 0,c=Math.min((void 0===u?e:s(u,e))-o,e-i),f=1;for(o<i&&i<o+c&&(f=-1,o+=c-1,i+=c-1);0<c--;)o in r?r[i]=r[o]:delete r[i],i+=f,o+=f;return r}},function(t,n,r){var e=r(71);t.exports=function(t,n){var r=[];return e(t,!1,r.push,r,n),r}},function(t,n,r){var s=r(21),l=r(17),h=r(116),v=r(8);t.exports=function(t,n,r,e,i){s(n);var o=l(t),u=h(o),c=v(o.length),f=i?c-1:0,a=i?-1:1;if(r<2)for(;;){if(f in u){e=u[f],f+=a;break}if(f+=a,i?f<0:c<=f)throw TypeError("Reduce of empty array with no initial value")}for(;i?0<=f:f<c;f+=a)f in u&&(e=n(e,u[f],f,o));return e}},function(t,n,r){"use strict";var o=r(21),u=r(5),c=r(175),f=[].slice,a={};t.exports=Function.bind||function(n){var r=o(this),e=f.call(arguments,1),i=function(){var t=e.concat(f.call(arguments));return this instanceof i?function(t,n,r){if(!(n in a)){for(var e=[],i=0;i<n;i++)e[i]="a["+i+"]";a[n]=Function("F,a","return new F("+e.join(",")+")")}return a[n](t,r)}(r,t.length,t):c(r,t,n)};return u(r.prototype)&&(i.prototype=r.prototype),i}},function(t,n,r){"use strict";var u=r(11).f,c=r(72),f=r(76),a=r(47),s=r(70),l=r(71),e=r(147),i=r(178),o=r(77),h=r(10),v=r(69).fastKey,p=r(80),d=h?"_s":"size",y=function(t,n){var r,e=v(n);if("F"!==e)return t._i[e];for(r=t._f;r;r=r.n)if(r.k==n)return r};t.exports={getConstructor:function(t,o,r,e){var i=t(function(t,n){s(t,i,o,"_i"),t._t=o,t._i=c(null),t._f=void 0,t._l=void 0,t[d]=0,null!=n&&l(n,r,t[e],t)});return f(i.prototype,{clear:function(){for(var t=p(this,o),n=t._i,r=t._f;r;r=r.n)r.r=!0,r.p&&(r.p=r.p.n=void 0),delete n[r.i];t._f=t._l=void 0,t[d]=0},delete:function(t){var n=p(this,o),r=y(n,t);if(r){var e=r.n,i=r.p;delete n._i[r.i],r.r=!0,i&&(i.n=e),e&&(e.p=i),n._f==r&&(n._f=e),n._l==r&&(n._l=i),n[d]--}return!!r},forEach:function(t){p(this,o);for(var n,r=a(t,1<arguments.length?arguments[1]:void 0,3);n=n?n.n:this._f;)for(r(n.v,n.k,this);n&&n.r;)n=n.p},has:function(t){return!!y(p(this,o),t)}}),h&&u(i.prototype,"size",{get:function(){return p(this,o)[d]}}),i},def:function(t,n,r){var e,i,o=y(t,n);return o?o.v=r:(t._l=o={i:i=v(n,!0),k:n,v:r,p:e=t._l,n:void 0,r:!1},t._f||(t._f=o),e&&(e.n=o),t[d]++,"F"!==i&&(t._i[i]=o)),t},getEntry:y,setStrong:function(t,r,n){e(t,r,function(t,n){this._t=p(t,r),this._k=n,this._l=void 0},function(){for(var t=this,n=t._k,r=t._l;r&&r.r;)r=r.p;return t._t&&(t._l=r=r?r.n:t._t._f)?i(0,"keys"==n?r.k:"values"==n?r.v:[r.k,r.v]):(t._t=void 0,i(1))},n?"entries":"values",!n,!0),o(r)}}},function(t,n,r){var e=r(81),i=r(167);t.exports=function(t){return function(){if(e(this)!=t)throw TypeError(t+"#toJSON isn't generic");return i(this)}}},function(t,n,r){"use strict";var u=r(76),c=r(69).getWeak,i=r(2),f=r(5),a=r(70),s=r(71),e=r(50),l=r(30),h=r(80),o=e(5),v=e(6),p=0,d=function(t){return t._l||(t._l=new y)},y=function(){this.a=[]},g=function(t,n){return o(t.a,function(t){return t[0]===n})};y.prototype={get:function(t){var n=g(this,t);if(n)return n[1]},has:function(t){return!!g(this,t)},set:function(t,n){var r=g(this,t);r?r[1]=n:this.a.push([t,n])},delete:function(n){var t=v(this.a,function(t){return t[0]===n});return~t&&this.a.splice(t,1),!!~t}},t.exports={getConstructor:function(t,r,e,i){var o=t(function(t,n){a(t,o,r,"_i"),t._t=r,t._i=p++,t._l=void 0,null!=n&&s(n,e,t[i],t)});return u(o.prototype,{delete:function(t){if(!f(t))return!1;var n=c(t);return!0===n?d(h(this,r)).delete(t):n&&l(n,this._i)&&delete n[this._i]},has:function(t){if(!f(t))return!1;var n=c(t);return!0===n?d(h(this,r)).has(t):n&&l(n,this._i)}}),o},def:function(t,n,r){var e=c(i(n),!0);return!0===e?d(t).set(n,r):e[t._i]=r,t},ufstore:d}},function(t,n,r){"use strict";var p=r(123),d=r(5),y=r(8),g=r(47),b=r(7)("isConcatSpreadable");t.exports=function t(n,r,e,i,o,u,c,f){for(var a,s,l=o,h=0,v=!!c&&g(c,f,3);h<i;){if(h in e){if(a=v?v(e[h],h,r):e[h],s=!1,d(a)&&(s=void 0!==(s=a[b])?!!s:p(a)),s&&0<u)l=t(n,r,a,y(a.length),l,u-1)-1;else{if(9007199254740991<=l)throw TypeError();n[l]=a}l++}h++}return l}},function(t,n,r){t.exports=!r(10)&&!r(4)(function(){return 7!=Object.defineProperty(r(140)("div"),"a",{get:function(){return 7}}).a})},function(t,n){t.exports=function(t,n,r){var e=void 0===r;switch(n.length){case 0:return e?t():t.call(r);case 1:return e?t(n[0]):t.call(r,n[0]);case 2:return e?t(n[0],n[1]):t.call(r,n[0],n[1]);case 3:return e?t(n[0],n[1],n[2]):t.call(r,n[0],n[1],n[2]);case 4:return e?t(n[0],n[1],n[2],n[3]):t.call(r,n[0],n[1],n[2],n[3])}return t.apply(r,n)}},function(t,n,r){var e=r(5),i=Math.floor;t.exports=function(t){return!e(t)&&isFinite(t)&&i(t)===t}},function(t,n,r){var o=r(2);t.exports=function(t,n,r,e){try{return e?n(o(r)[0],r[1]):n(r)}catch(n){var i=t.return;throw void 0!==i&&o(i.call(t)),n}}},function(t,n){t.exports=function(t,n){return{value:n,done:!!t}}},function(t,n,r){var o=r(149),e=Math.pow,u=e(2,-52),c=e(2,-23),f=e(2,127)*(2-c),a=e(2,-126);t.exports=Math.fround||function(t){var n,r,e=Math.abs(t),i=o(t);return e<a?i*(e/a/c+1/u-1/u)*a*c:f<(r=(n=(1+c/u)*e)-(n-e))||r!=r?i*(1/0):i*r}},function(t,n){t.exports=Math.log1p||function(t){return-1e-8<(t=+t)&&t<1e-8?t-t*t/2:Math.log(1+t)}},function(t,n){t.exports=Math.scale||function(t,n,r,e,i){return 0===arguments.length||t!=t||n!=n||r!=r||e!=e||i!=i?NaN:t===1/0||t===-1/0?t:(t-n)*(i-e)/(r-n)+e}},function(t,n,r){"use strict";var h=r(10),v=r(74),p=r(127),d=r(117),y=r(17),g=r(116),i=Object.assign;t.exports=!i||r(4)(function(){var t={},n={},r=Symbol(),e="abcdefghijklmnopqrst";return t[r]=7,e.split("").forEach(function(t){n[t]=t}),7!=i({},t)[r]||Object.keys(i({},n)).join("")!=e})?function(t,n){for(var r=y(t),e=arguments.length,i=1,o=p.f,u=d.f;i<e;)for(var c,f=g(arguments[i++]),a=o?v(f).concat(o(f)):v(f),s=a.length,l=0;l<s;)c=a[l++],h&&!u.call(f,c)||(r[c]=f[c]);return r}:i},function(t,n,r){var u=r(11),c=r(2),f=r(74);t.exports=r(10)?Object.defineProperties:function(t,n){c(t);for(var r,e=f(n),i=e.length,o=0;o<i;)u.f(t,r=e[o++],n[r]);return t}},function(t,n,r){var e=r(33),i=r(73).f,o={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return u&&"[object Window]"==o.call(t)?function(t){try{return i(t)}catch(t){return u.slice()}}(t):i(e(t))}},function(t,n,r){var u=r(30),c=r(33),f=r(120)(!1),a=r(154)("IE_PROTO");t.exports=function(t,n){var r,e=c(t),i=0,o=[];for(r in e)r!=a&&u(e,r)&&o.push(r);for(;n.length>i;)u(e,r=n[i++])&&(~f(o,r)||o.push(r));return o}},function(t,n,r){var f=r(10),a=r(74),s=r(33),l=r(117).f;t.exports=function(c){return function(t){for(var n,r=s(t),e=a(r),i=e.length,o=0,u=[];o<i;)n=e[o++],f&&!l.call(r,n)||u.push(c?[n,r[n]]:r[n]);return u}}},function(t,n,r){var e=r(73),i=r(127),o=r(2),u=r(3).Reflect;t.exports=u&&u.ownKeys||function(t){var n=e.f(o(t)),r=i.f;return r?n.concat(r(t)):n}},function(t,n,r){var e=r(3).parseFloat,i=r(84).trim;t.exports=1/e(r(157)+"-0")!=-1/0?function(t){var n=i(String(t),3),r=e(n);return 0===r&&"-"==n.charAt(0)?-0:r}:e},function(t,n,r){var e=r(3).parseInt,i=r(84).trim,o=r(157),u=/^[-+]?0[xX]/;t.exports=8!==e(o+"08")||22!==e(o+"0x16")?function(t,n){var r=i(String(t),3);return e(r,n>>>0||(u.test(r)?16:10))}:e},function(t,n){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,n,r){var e=r(2),i=r(5),o=r(151);t.exports=function(t,n){if(e(t),i(n)&&n.constructor===t)return n;var r=o.f(t);return(0,r.resolve)(n),r.promise}},function(t,n){t.exports=Object.is||function(t,n){return t===n?0!==t||1/t==1/n:t!=t&&n!=n}},function(t,n,r){var s=r(8),l=r(156),h=r(51);t.exports=function(t,n,r,e){var i=String(h(t)),o=i.length,u=void 0===r?" ":String(r),c=s(n);if(c<=o||""==u)return i;var f=c-o,a=l.call(u,Math.ceil(f/u.length));return a.length>f&&(a=a.slice(0,f)),e?a+i:i+a}},function(t,n,r){var e=r(49),i=r(8);t.exports=function(t){if(void 0===t)return 0;var n=e(t),r=i(n);if(n!==r)throw RangeError("Wrong length!");return r}},function(t,n,r){n.f=r(7)},function(t,n,r){"use strict";var e=r(170),i=r(80);t.exports=r(121)("Map",function(t){return function(){return t(this,0<arguments.length?arguments[0]:void 0)}},{get:function(t){var n=e.getEntry(i(this,"Map"),t);return n&&n.v},set:function(t,n){return e.def(i(this,"Map"),0===t?0:t,n)}},e,!0)},function(t,n,r){"use strict";var e=r(152);r(1)({target:"RegExp",proto:!0,forced:e!==/./.exec},{exec:e})},function(t,n,r){r(10)&&"g"!=/./g.flags&&r(11).f(RegExp.prototype,"flags",{configurable:!0,get:r(115)})},function(t,n,r){"use strict";var e=r(170),i=r(80);t.exports=r(121)("Set",function(t){return function(){return t(this,0<arguments.length?arguments[0]:void 0)}},{add:function(t){return e.def(i(this,"Set"),t=0===t?0:t,t)}},e)},function(t,n,r){"use strict";var o,e=r(3),i=r(50)(0),u=r(27),c=r(69),f=r(182),a=r(172),s=r(5),l=r(80),h=r(80),v=!e.ActiveXObject&&"ActiveXObject"in e,p="WeakMap",d=c.getWeak,y=Object.isExtensible,g=a.ufstore,b=function(t){return function(){return t(this,0<arguments.length?arguments[0]:void 0)}},x={get:function(t){if(s(t)){var n=d(t);return!0===n?g(l(this,p)).get(t):n?n[this._i]:void 0}},set:function(t,n){return a.def(l(this,p),t,n)}},m=t.exports=r(121)(p,b,x,a,!0,!0);h&&v&&(f((o=a.getConstructor(b,p)).prototype,x),c.NEED=!0,i(["delete","has","get","set"],function(e){var t=m.prototype,i=t[e];u(t,e,function(t,n){if(!s(t)||y(t))return i.call(this,t,n);this._f||(this._f=new o);var r=this._f[e](t,n);return"set"==e?this:r})}))},,,,function(t,n){"use strict";t.exports={init:function(){var t=document.querySelector("#page-nav");t&&!document.querySelector("#page-nav .extend.prev")&&(t.innerHTML='<a class="extend prev disabled" rel="prev">&laquo; Prev</a>'+t.innerHTML),t&&!document.querySelector("#page-nav .extend.next")&&(t.innerHTML=t.innerHTML+'<a class="extend next disabled" rel="next">Next &raquo;</a>'),yiliaConfig&&yiliaConfig.open_in_new&&document.querySelectorAll(".article-entry a:not(.article-more-a)").forEach(function(t){var n=t.getAttribute("target");n&&""!==n||t.setAttribute("target","_blank")}),yiliaConfig&&yiliaConfig.toc_hide_index&&document.querySelectorAll(".toc-number").forEach(function(t){t.style.display="none"})}}},function(t,n,r){"use strict";function e(t){return t&&t.__esModule?t:{default:t}}function i(t,n,r,e,i){var o=function(t){for(var n=t.offsetLeft,r=t.offsetParent;null!==r;)n+=r.offsetLeft,r=r.offsetParent;return n}(t),u=function(t){for(var n=t.offsetTop,r=t.offsetParent;null!==r;)n+=r.offsetTop,r=r.offsetParent;return n}(t)-n;if(u-r<=i){var c=t.$newDom;c||(c=t.cloneNode(!0),(0,a.default)(t,c),(t.$newDom=c).style.position="fixed",c.style.top=(r||u)+"px",c.style.left=o+"px",c.style.zIndex=e||2,c.style.width="100%",c.style.color="#fff"),c.style.visibility="visible",t.style.visibility="hidden"}else{t.style.visibility="visible";var f=t.$newDom;f&&(f.style.visibility="hidden")}}function o(){var t=document.querySelector(".js-overlay"),n=document.querySelector(".js-header-menu");i(t,document.body.scrollTop,-63,2,0),i(n,document.body.scrollTop,1,3,0)}var f=e(r(163)),a=e((e(r(164)),r(414))),u=e(r(134)),c=e(r(204)),s=r(135);u.default.versions.mobile&&window.screen.width<800&&(function(){for(var t=document.querySelectorAll(".js-header-menu li a"),n=window.location.pathname,r=0,e=t.length;r<e;r++){var i=t[r];o=n,u=i.getAttribute("href"),c=/\/|index.html/g,o.replace(c,"")===u.replace(c,"")&&(0,f.default)(i,"active")}var o,u,c}(),document.querySelector("#container").addEventListener("scroll",function(t){o()}),window.addEventListener("scroll",function(t){o()}),o()),(0,s.addLoadEvent)(function(){c.default.init()}),t.exports={}},,,function(t,n,r){(function(t){"use strict";function n(t,n,r){t[n]||Object.defineProperty(t,n,{writable:!0,configurable:!0,value:r})}if(r(413),r(209),r(211),t._babelPolyfill)throw new Error("only one instance of babel-polyfill is allowed");t._babelPolyfill=!0;n(String.prototype,"padLeft","".padStart),n(String.prototype,"padRight","".padEnd),"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function(t){[][t]&&n(Array,t,Function.call.bind([][t]))})}).call(n,function(){return this}())},function(L,t){(function(t){!function(t){"use strict";function o(t,n,r,e){var o,u,c,f,i=n&&n.prototype instanceof h?n:h,a=Object.create(i.prototype),s=new p(e||[]);return a._invoke=(o=t,u=r,c=s,f=_,function(t,n){if(f===E)throw new Error("Generator is already running");if(f===M){if("throw"===t)throw n;return d()}for(c.method=t,c.arg=n;;){var r=c.delegate;if(r){var e=v(r,c);if(e){if(e===P)continue;return e}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if(f===_)throw f=M,c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);f=E;var i=l(o,u,c);if("normal"===i.type){if(f=c.done?M:O,i.arg===P)continue;return{value:i.arg,done:c.done}}"throw"===i.type&&(f=M,c.method="throw",c.arg=i.arg)}}),a}function l(t,n,r){try{return{type:"normal",arg:t.call(n,r)}}catch(t){return{type:"throw",arg:t}}}function h(){}function r(){}function n(){}function e(t){["next","throw","return"].forEach(function(n){t[n]=function(t){return this._invoke(n,t)}})}function u(c){function f(t,n,r,e){var i=l(c[t],c,n);if("throw"!==i.type){var o=i.arg,u=o.value;return u&&"object"==typeof u&&y.call(u,"__await")?Promise.resolve(u.__await).then(function(t){f("next",t,r,e)},function(t){f("throw",t,r,e)}):Promise.resolve(u).then(function(t){o.value=t,r(o)},e)}e(i.arg)}var n;"object"==typeof t.process&&t.process.domain&&(f=t.process.domain.bind(f)),this._invoke=function(r,e){function t(){return new Promise(function(t,n){f(r,e,t,n)})}return n=n?n.then(t,t):t()}}function v(t,n){var r=t.iterator[n.method];if(r===a){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=a,v(t,n),"throw"===n.method))return P;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return P}var e=l(r,t.iterator,n.arg);if("throw"===e.type)return n.method="throw",n.arg=e.arg,n.delegate=null,P;var i=e.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=a),n.delegate=null,P):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,P)}function i(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function c(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function p(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(i,this),this.reset(!0)}function f(n){if(n){var t=n[b];if(t)return t.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var r=-1,e=function t(){for(;++r<n.length;)if(y.call(n,r))return t.value=n[r],t.done=!1,t;return t.value=a,t.done=!0,t};return e.next=e}}return{next:d}}function d(){return{value:a,done:!0}}var a,s=Object.prototype,y=s.hasOwnProperty,g="function"==typeof Symbol?Symbol:{},b=g.iterator||"@@iterator",x=g.asyncIterator||"@@asyncIterator",m=g.toStringTag||"@@toStringTag",S="object"==typeof L,w=t.regeneratorRuntime;if(w)S&&(L.exports=w);else{(w=t.regeneratorRuntime=S?L.exports:{}).wrap=o;var _="suspendedStart",O="suspendedYield",E="executing",M="completed",P={},j={};j[b]=function(){return this};var F=Object.getPrototypeOf,A=F&&F(F(f([])));A&&A!==s&&y.call(A,b)&&(j=A);var I=n.prototype=h.prototype=Object.create(j);r.prototype=I.constructor=n,n.constructor=r,n[m]=r.displayName="GeneratorFunction",w.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===r||"GeneratorFunction"===(n.displayName||n.name))},w.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,n):(t.__proto__=n,m in t||(t[m]="GeneratorFunction")),t.prototype=Object.create(I),t},w.awrap=function(t){return{__await:t}},e(u.prototype),u.prototype[x]=function(){return this},w.AsyncIterator=u,w.async=function(t,n,r,e){var i=new u(o(t,n,r,e));return w.isGeneratorFunction(n)?i:i.next().then(function(t){return t.done?t.value:i.next()})},e(I),I[m]="Generator",I[b]=function(){return this},I.toString=function(){return"[object Generator]"},w.keys=function(r){var e=[];for(var t in r)e.push(t);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},w.values=f,p.prototype={constructor:p,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=a,this.done=!1,this.delegate=null,this.method="next",this.arg=a,this.tryEntries.forEach(c),!t)for(var n in this)"t"===n.charAt(0)&&y.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=a)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){function t(t,n){return o.type="throw",o.arg=r,e.next=t,n&&(e.method="next",e.arg=a),!!n}if(this.done)throw r;for(var e=this,n=this.tryEntries.length-1;0<=n;--n){var i=this.tryEntries[n],o=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var u=y.call(i,"catchLoc"),c=y.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(t,n){for(var r=this.tryEntries.length-1;0<=r;--r){var e=this.tryEntries[r];if(e.tryLoc<=this.prev&&y.call(e,"finallyLoc")&&this.prev<e.finallyLoc){var i=e;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=n,i?(this.method="next",this.next=i.finallyLoc,P):this.complete(o)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),P},finish:function(t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),c(r),P}},catch:function(t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var e=r.completion;if("throw"===e.type){var i=e.arg;c(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:f(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=a),P}}}}("object"==typeof t?t:"object"==typeof window?window:"object"==typeof self?self:this)}).call(t,function(){return this}())},,function(t,n,r){r(221),t.exports=r(46).RegExp.escape},,,,function(t,n,r){var e=r(5),i=r(123),o=r(7)("species");t.exports=function(t){var n;return i(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!i(n.prototype)||(n=void 0),e(n)&&(null===(n=n[o])&&(n=void 0))),void 0===n?Array:n}},function(t,n,r){"use strict";var e=r(4),i=Date.prototype.getTime,o=Date.prototype.toISOString,u=function(t){return 9<t?t:"0"+t};t.exports=e(function(){return"0385-07-25T07:06:39.999Z"!=o.call(new Date(-5e13-1))})||!e(function(){o.call(new Date(NaN))})?function(){if(!isFinite(i.call(this)))throw RangeError("Invalid time value");var t=this,n=t.getUTCFullYear(),r=t.getUTCMilliseconds(),e=n<0?"-":9999<n?"+":"";return e+("00000"+Math.abs(n)).slice(e?-6:-4)+"-"+u(t.getUTCMonth()+1)+"-"+u(t.getUTCDate())+"T"+u(t.getUTCHours())+":"+u(t.getUTCMinutes())+":"+u(t.getUTCSeconds())+"."+(99<r?r:"0"+u(r))+"Z"}:o},function(t,n,r){"use strict";var e=r(2),i=r(53);t.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return i(e(this),"number"!=t)}},function(t,n,r){var c=r(74),f=r(127),a=r(117);t.exports=function(t){var n=c(t),r=f.f;if(r)for(var e,i=r(t),o=a.f,u=0;i.length>u;)o.call(t,e=i[u++])&&n.push(e);return n}},function(t,n,r){t.exports=r(118)("native-function-to-string",Function.toString)},function(t,n){t.exports=function(n,r){var e=r===Object(r)?function(t){return r[t]}:r;return function(t){return String(t).replace(n,e)}}},function(t,n,r){var e=r(1),i=r(220)(/[\\^$*+?.()|[\]{}]/g,"\\$&");e(e.S,"RegExp",{escape:function(t){return i(t)}})},function(t,n,r){var e=r(1);e(e.P,"Array",{copyWithin:r(166)}),r(67)("copyWithin")},function(t,n,r){"use strict";var e=r(1),i=r(50)(4);e(e.P+e.F*!r(48)([].every,!0),"Array",{every:function(t){return i(this,t,arguments[1])}})},function(t,n,r){var e=r(1);e(e.P,"Array",{fill:r(137)}),r(67)("fill")},function(t,n,r){"use strict";var e=r(1),i=r(50)(2);e(e.P+e.F*!r(48)([].filter,!0),"Array",{filter:function(t){return i(this,t,arguments[1])}})},function(t,n,r){"use strict";var e=r(1),i=r(50)(6),o="findIndex",u=!0;o in[]&&Array(1)[o](function(){u=!1}),e(e.P+e.F*u,"Array",{findIndex:function(t){return i(this,t,1<arguments.length?arguments[1]:void 0)}}),r(67)(o)},function(t,n,r){"use strict";var e=r(1),i=r(50)(5),o="find",u=!0;o in[]&&Array(1)[o](function(){u=!1}),e(e.P+e.F*u,"Array",{find:function(t){return i(this,t,1<arguments.length?arguments[1]:void 0)}}),r(67)(o)},function(t,n,r){"use strict";var e=r(1),i=r(50)(0),o=r(48)([].forEach,!0);e(e.P+e.F*!o,"Array",{forEach:function(t){return i(this,t,arguments[1])}})},function(t,n,r){"use strict";var h=r(47),e=r(1),v=r(17),p=r(177),d=r(145),y=r(8),g=r(139),b=r(161);e(e.S+e.F*!r(125)(function(t){Array.from(t)}),"Array",{from:function(t){var n,r,e,i,o=v(t),u="function"==typeof this?this:Array,c=arguments.length,f=1<c?arguments[1]:void 0,a=void 0!==f,s=0,l=b(o);if(a&&(f=h(f,2<c?arguments[2]:void 0,2)),null==l||u==Array&&d(l))for(r=new u(n=y(o.length));s<n;s++)g(r,s,a?f(o[s],s):o[s]);else for(i=l.call(o),r=new u;!(e=i.next()).done;s++)g(r,s,a?p(i,f,[e.value,s],!0):e.value);return r.length=s,r}})},function(t,n,r){"use strict";var e=r(1),i=r(120)(!1),o=[].indexOf,u=!!o&&1/[1].indexOf(1,-0)<0;e(e.P+e.F*(u||!r(48)(o)),"Array",{indexOf:function(t){return u?o.apply(this,arguments)||0:i(this,t,arguments[1])}})},function(t,n,r){var e=r(1);e(e.S,"Array",{isArray:r(123)})},function(t,n,r){"use strict";var e=r(1),i=r(33),o=[].join;e(e.P+e.F*(r(116)!=Object||!r(48)(o)),"Array",{join:function(t){return o.call(i(this),void 0===t?",":t)}})},function(t,n,r){"use strict";var e=r(1),i=r(33),o=r(49),u=r(8),c=[].lastIndexOf,f=!!c&&1/[1].lastIndexOf(1,-0)<0;e(e.P+e.F*(f||!r(48)(c)),"Array",{lastIndexOf:function(t){if(f)return c.apply(this,arguments)||0;var n=i(this),r=u(n.length),e=r-1;for(1<arguments.length&&(e=Math.min(e,o(arguments[1]))),e<0&&(e=r+e);0<=e;e--)if(e in n&&n[e]===t)return e||0;return-1}})},function(t,n,r){"use strict";var e=r(1),i=r(50)(1);e(e.P+e.F*!r(48)([].map,!0),"Array",{map:function(t){return i(this,t,arguments[1])}})},function(t,n,r){"use strict";var e=r(1),i=r(139);e(e.S+e.F*r(4)(function(){function t(){}return!(Array.of.call(t)instanceof t)}),"Array",{of:function(){for(var t=0,n=arguments.length,r=new("function"==typeof this?this:Array)(n);t<n;)i(r,t,arguments[t++]);return r.length=n,r}})},function(t,n,r){"use strict";var e=r(1),i=r(168);e(e.P+e.F*!r(48)([].reduceRight,!0),"Array",{reduceRight:function(t){return i(this,t,arguments.length,arguments[1],!0)}})},function(t,n,r){"use strict";var e=r(1),i=r(168);e(e.P+e.F*!r(48)([].reduce,!0),"Array",{reduce:function(t){return i(this,t,arguments.length,arguments[1],!1)}})},function(t,n,r){"use strict";var e=r(1),i=r(143),a=r(45),s=r(78),l=r(8),h=[].slice;e(e.P+e.F*r(4)(function(){i&&h.call(i)}),"Array",{slice:function(t,n){var r=l(this.length),e=a(this);if(n=void 0===n?r:n,"Array"==e)return h.call(this,t,n);for(var i=s(t,r),o=s(n,r),u=l(o-i),c=new Array(u),f=0;f<u;f++)c[f]="String"==e?this.charAt(i+f):this[i+f];return c}})},function(t,n,r){"use strict";var e=r(1),i=r(50)(3);e(e.P+e.F*!r(48)([].some,!0),"Array",{some:function(t){return i(this,t,arguments[1])}})},function(t,n,r){"use strict";var e=r(1),i=r(21),o=r(17),u=r(4),c=[].sort,f=[1,2,3];e(e.P+e.F*(u(function(){f.sort(void 0)})||!u(function(){f.sort(null)})||!r(48)(c)),"Array",{sort:function(t){return void 0===t?c.call(o(this)):c.call(o(this),i(t))}})},function(t,n,r){r(77)("Array")},function(t,n,r){var e=r(1);e(e.S,"Date",{now:function(){return(new Date).getTime()}})},function(t,n,r){var e=r(1),i=r(216);e(e.P+e.F*(Date.prototype.toISOString!==i),"Date",{toISOString:i})},function(t,n,r){"use strict";var e=r(1),i=r(17),o=r(53);e(e.P+e.F*r(4)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(t){var n=i(this),r=o(n);return"number"!=typeof r||isFinite(r)?n.toISOString():null}})},function(t,n,r){var e=r(7)("toPrimitive"),i=Date.prototype;e in i||r(26)(i,e,r(217))},function(t,n,r){var e=Date.prototype,i="Invalid Date",o="toString",u=e[o],c=e.getTime;new Date(NaN)+""!=i&&r(27)(e,o,function(){var t=c.call(this);return t==t?u.call(this):i})},function(t,n,r){var e=r(1);e(e.P,"Function",{bind:r(169)})},function(t,n,r){"use strict";var e=r(5),i=r(32),o=r(7)("hasInstance"),u=Function.prototype;o in u||r(11).f(u,o,{value:function(t){if("function"!=typeof this||!e(t))return!1;if(!e(this.prototype))return t instanceof this;for(;t=i(t);)if(this.prototype===t)return!0;return!1}})},function(t,n,r){var e=r(11).f,i=Function.prototype,o=/^\s*function ([^ (]*)/;"name"in i||r(10)&&e(i,"name",{configurable:!0,get:function(){try{return(""+this).match(o)[1]}catch(t){return""}}})},function(t,n,r){var e=r(1),i=r(180),o=Math.sqrt,u=Math.acosh;e(e.S+e.F*!(u&&710==Math.floor(u(Number.MAX_VALUE))&&u(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:94906265.62425156<t?Math.log(t)+Math.LN2:i(t-1+o(t-1)*o(t+1))}})},function(t,n,r){var e=r(1),i=Math.asinh;e(e.S+e.F*!(i&&0<1/i(0)),"Math",{asinh:function t(n){return isFinite(n=+n)&&0!=n?n<0?-t(-n):Math.log(n+Math.sqrt(n*n+1)):n}})},function(t,n,r){var e=r(1),i=Math.atanh;e(e.S+e.F*!(i&&1/i(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},function(t,n,r){var e=r(1),i=r(149);e(e.S,"Math",{cbrt:function(t){return i(t=+t)*Math.pow(Math.abs(t),1/3)}})},function(t,n,r){var e=r(1);e(e.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,n,r){var e=r(1),i=Math.exp;e(e.S,"Math",{cosh:function(t){return(i(t=+t)+i(-t))/2}})},function(t,n,r){var e=r(1),i=r(148);e(e.S+e.F*(i!=Math.expm1),"Math",{expm1:i})},function(t,n,r){var e=r(1);e(e.S,"Math",{fround:r(179)})},function(t,n,r){var e=r(1),f=Math.abs;e(e.S,"Math",{hypot:function(t,n){for(var r,e,i=0,o=0,u=arguments.length,c=0;o<u;)c<(r=f(arguments[o++]))?(i=i*(e=c/r)*e+1,c=r):0<r?i+=(e=r/c)*e:i+=r;return c===1/0?1/0:c*Math.sqrt(i)}})},function(t,n,r){var e=r(1),i=Math.imul;e(e.S+e.F*r(4)(function(){return-5!=i(4294967295,5)||2!=i.length}),"Math",{imul:function(t,n){var r=65535,e=+t,i=+n,o=r&e,u=r&i;return 0|o*u+((r&e>>>16)*u+o*(r&i>>>16)<<16>>>0)}})},function(t,n,r){var e=r(1);e(e.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},function(t,n,r){var e=r(1);e(e.S,"Math",{log1p:r(180)})},function(t,n,r){var e=r(1);e(e.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},function(t,n,r){var e=r(1);e(e.S,"Math",{sign:r(149)})},function(t,n,r){var e=r(1),i=r(148),o=Math.exp;e(e.S+e.F*r(4)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(i(t)-i(-t))/2:(o(t-1)-o(-t-1))*(Math.E/2)}})},function(t,n,r){var e=r(1),i=r(148),o=Math.exp;e(e.S,"Math",{tanh:function(t){var n=i(t=+t),r=i(-t);return n==1/0?1:r==1/0?-1:(n-r)/(o(t)+o(-t))}})},function(t,n,r){var e=r(1);e(e.S,"Math",{trunc:function(t){return(0<t?Math.floor:Math.ceil)(t)}})},function(t,n,r){"use strict";var e=r(3),i=r(30),o=r(45),u=r(144),s=r(53),c=r(4),f=r(73).f,a=r(31).f,l=r(11).f,h=r(84).trim,v="Number",p=e[v],d=p,y=p.prototype,g=o(r(72)(y))==v,b="trim"in String.prototype,x=function(t){var n=s(t,!1);if("string"==typeof n&&2<n.length){var r,e,i,o=(n=b?n.trim():h(n,3)).charCodeAt(0);if(43===o||45===o){if(88===(r=n.charCodeAt(2))||120===r)return NaN}else if(48===o){switch(n.charCodeAt(1)){case 66:case 98:e=2,i=49;break;case 79:case 111:e=8,i=55;break;default:return+n}for(var u,c=n.slice(2),f=0,a=c.length;f<a;f++)if((u=c.charCodeAt(f))<48||i<u)return NaN;return parseInt(c,e)}}return+n};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(t){var n=arguments.length<1?0:t,r=this;return r instanceof p&&(g?c(function(){y.valueOf.call(r)}):o(r)!=v)?u(new d(x(n)),r,p):x(n)};for(var m,S=r(10)?f(d):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),w=0;S.length>w;w++)i(d,m=S[w])&&!i(p,m)&&l(p,m,a(d,m));(p.prototype=y).constructor=p,r(27)(e,v,p)}},function(t,n,r){var e=r(1);e(e.S,"Number",{EPSILON:Math.pow(2,-52)})},function(t,n,r){var e=r(1),i=r(3).isFinite;e(e.S,"Number",{isFinite:function(t){return"number"==typeof t&&i(t)}})},function(t,n,r){var e=r(1);e(e.S,"Number",{isInteger:r(176)})},function(t,n,r){var e=r(1);e(e.S,"Number",{isNaN:function(t){return t!=t}})},function(t,n,r){var e=r(1),i=r(176),o=Math.abs;e(e.S,"Number",{isSafeInteger:function(t){return i(t)&&o(t)<=9007199254740991}})},function(t,n,r){var e=r(1);e(e.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(t,n,r){var e=r(1);e(e.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(t,n,r){var e=r(1),i=r(188);e(e.S+e.F*(Number.parseFloat!=i),"Number",{parseFloat:i})},function(t,n,r){var e=r(1),i=r(189);e(e.S+e.F*(Number.parseInt!=i),"Number",{parseInt:i})},function(t,n,r){"use strict";var e=r(1),a=r(49),s=r(165),l=r(156),i=1..toFixed,o=Math.floor,u=[0,0,0,0,0,0],h="Number.toFixed: incorrect invocation!",v=function(t,n){for(var r=-1,e=n;++r<6;)e+=t*u[r],u[r]=e%1e7,e=o(e/1e7)},p=function(t){for(var n=6,r=0;0<=--n;)r+=u[n],u[n]=o(r/t),r=r%t*1e7},d=function(){for(var t=6,n="";0<=--t;)if(""!==n||0===t||0!==u[t]){var r=String(u[t]);n=""===n?r:n+l.call("0",7-r.length)+r}return n},y=function(t,n,r){return 0===n?r:n%2==1?y(t,n-1,r*t):y(t*t,n/2,r)};e(e.P+e.F*(!!i&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!r(4)(function(){i.call({})})),"Number",{toFixed:function(t){var n,r,e,i,o=s(this,h),u=a(t),c="",f="0";if(u<0||20<u)throw RangeError(h);if(o!=o)return"NaN";if(o<=-1e21||1e21<=o)return String(o);if(o<0&&(c="-",o=-o),1e-21<o)if(r=(n=function(t){for(var n=0,r=t;4096<=r;)n+=12,r/=4096;for(;2<=r;)n+=1,r/=2;return n}(o*y(2,69,1))-69)<0?o*y(2,-n,1):o/y(2,n,1),r*=4503599627370496,0<(n=52-n)){for(v(0,r),e=u;7<=e;)v(1e7,0),e-=7;for(v(y(10,e,1),0),e=n-1;23<=e;)p(1<<23),e-=23;p(1<<e),v(1,1),p(2),f=d()}else v(0,r),v(1<<-n,0),f=d()+l.call("0",u);return f=0<u?c+((i=f.length)<=u?"0."+l.call("0",u-i)+f:f.slice(0,i-u)+"."+f.slice(i-u)):c+f}})},function(t,n,r){"use strict";var e=r(1),i=r(4),o=r(165),u=1..toPrecision;e(e.P+e.F*(i(function(){return"1"!==u.call(1,void 0)})||!i(function(){u.call({})})),"Number",{toPrecision:function(t){var n=o(this,"Number#toPrecision: incorrect invocation!");return void 0===t?u.call(n):u.call(n,t)}})},function(t,n,r){var e=r(1);e(e.S+e.F,"Object",{assign:r(182)})},function(t,n,r){var e=r(1);e(e.S,"Object",{create:r(72)})},function(t,n,r){var e=r(1);e(e.S+e.F*!r(10),"Object",{defineProperties:r(183)})},function(t,n,r){var e=r(1);e(e.S+e.F*!r(10),"Object",{defineProperty:r(11).f})},function(t,n,r){var e=r(5),i=r(69).onFreeze;r(52)("freeze",function(n){return function(t){return n&&e(t)?n(i(t)):t}})},function(t,n,r){var e=r(33),i=r(31).f;r(52)("getOwnPropertyDescriptor",function(){return function(t,n){return i(e(t),n)}})},function(t,n,r){r(52)("getOwnPropertyNames",function(){return r(184).f})},function(t,n,r){var e=r(17),i=r(32);r(52)("getPrototypeOf",function(){return function(t){return i(e(t))}})},function(t,n,r){var e=r(5);r(52)("isExtensible",function(n){return function(t){return!!e(t)&&(!n||n(t))}})},function(t,n,r){var e=r(5);r(52)("isFrozen",function(n){return function(t){return!e(t)||!!n&&n(t)}})},function(t,n,r){var e=r(5);r(52)("isSealed",function(n){return function(t){return!e(t)||!!n&&n(t)}})},function(t,n,r){var e=r(1);e(e.S,"Object",{is:r(192)})},function(t,n,r){var e=r(17),i=r(74);r(52)("keys",function(){return function(t){return i(e(t))}})},function(t,n,r){var e=r(5),i=r(69).onFreeze;r(52)("preventExtensions",function(n){return function(t){return n&&e(t)?n(i(t)):t}})},function(t,n,r){var e=r(5),i=r(69).onFreeze;r(52)("seal",function(n){return function(t){return n&&e(t)?n(i(t)):t}})},function(t,n,r){var e=r(1);e(e.S,"Object",{setPrototypeOf:r(153).set})},function(t,n,r){"use strict";var e=r(81),i={};i[r(7)("toStringTag")]="z",i+""!="[object z]"&&r(27)(Object.prototype,"toString",function(){return"[object "+e(this)+"]"},!0)},function(t,n,r){var e=r(1),i=r(188);e(e.G+e.F*(parseFloat!=i),{parseFloat:i})},function(t,n,r){var e=r(1),i=r(189);e(e.G+e.F*(parseInt!=i),{parseInt:i})},function(t,n,r){"use strict";var e,i,o,u,c=r(68),f=r(3),a=r(47),s=r(81),l=r(1),h=r(5),v=r(21),p=r(70),d=r(71),y=r(119),g=r(158).set,b=r(150)(),x=r(151),m=r(190),S=r(133),w=r(191),_="Promise",O=f.TypeError,E=f.process,M=E&&E.versions,P=M&&M.v8||"",j=f[_],F="process"==s(E),A=function(){},I=i=x.f,L=!!function(){try{var t=j.resolve(1),n=(t.constructor={})[r(7)("species")]=function(t){t(A,A)};return(F||"function"==typeof PromiseRejectionEvent)&&t.then(A)instanceof n&&0!==P.indexOf("6.6")&&-1===S.indexOf("Chrome/66")}catch(t){}}(),N=function(t){var n;return!(!h(t)||"function"!=typeof(n=t.then))&&n},T=function(s,r){if(!s._n){s._n=!0;var e=s._c;b(function(){for(var f=s._v,a=1==s._s,t=0,n=function(t){var n,r,e,i=a?t.ok:t.fail,o=t.resolve,u=t.reject,c=t.domain;try{i?(a||(2==s._h&&C(s),s._h=1),!0===i?n=f:(c&&c.enter(),n=i(f),c&&(c.exit(),e=!0)),n===t.promise?u(O("Promise-chain cycle")):(r=N(n))?r.call(n,o,u):o(n)):u(f)}catch(t){c&&!e&&c.exit(),u(t)}};e.length>t;)n(e[t++]);s._c=[],s._n=!1,r&&!s._h&&k(s)})}},k=function(o){g.call(f,function(){var t,n,r,e=o._v,i=R(o);if(i&&(t=m(function(){F?E.emit("unhandledRejection",e,o):(n=f.onunhandledrejection)?n({promise:o,reason:e}):(r=f.console)&&r.error&&r.error("Unhandled promise rejection",e)}),o._h=F||R(o)?2:1),o._a=void 0,i&&t.e)throw t.v})},R=function(t){return 1!==t._h&&0===(t._a||t._c).length},C=function(n){g.call(f,function(){var t;F?E.emit("rejectionHandled",n):(t=f.onrejectionhandled)&&t({promise:n,reason:n._v})})},D=function(t){var n=this;n._d||(n._d=!0,(n=n._w||n)._v=t,n._s=2,n._a||(n._a=n._c.slice()),T(n,!0))},G=function(t){var r,e=this;if(!e._d){e._d=!0,e=e._w||e;try{if(e===t)throw O("Promise can't be resolved itself");(r=N(t))?b(function(){var n={_w:e,_d:!1};try{r.call(t,a(G,n,1),a(D,n,1))}catch(t){D.call(n,t)}}):(e._v=t,e._s=1,T(e,!1))}catch(t){D.call({_w:e,_d:!1},t)}}};L||(j=function(t){p(this,j,_,"_h"),v(t),e.call(this);try{t(a(G,this,1),a(D,this,1))}catch(t){D.call(this,t)}},(e=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=r(76)(j.prototype,{then:function(t,n){var r=I(y(this,j));return r.ok="function"!=typeof t||t,r.fail="function"==typeof n&&n,r.domain=F?E.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&T(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new e;this.promise=t,this.resolve=a(G,t,1),this.reject=a(D,t,1)},x.f=I=function(t){return t===j||t===u?new o(t):i(t)}),l(l.G+l.W+l.F*!L,{Promise:j}),r(83)(j,_),r(77)(_),u=r(46)[_],l(l.S+l.F*!L,_,{reject:function(t){var n=I(this);return(0,n.reject)(t),n.promise}}),l(l.S+l.F*(c||!L),_,{resolve:function(t){return w(c&&this===u?j:this,t)}}),l(l.S+l.F*!(L&&r(125)(function(t){j.all(t).catch(A)})),_,{all:function(t){var u=this,n=I(u),c=n.resolve,f=n.reject,r=m(function(){var e=[],i=0,o=1;d(t,!1,function(t){var n=i++,r=!1;e.push(void 0),o++,u.resolve(t).then(function(t){r||(r=!0,e[n]=t,--o||c(e))},f)}),--o||c(e)});return r.e&&f(r.v),n.promise},race:function(t){var n=this,r=I(n),e=r.reject,i=m(function(){d(t,!1,function(t){n.resolve(t).then(r.resolve,e)})});return i.e&&e(i.v),r.promise}})},function(t,n,r){var e=r(1),o=r(21),u=r(2),c=(r(3).Reflect||{}).apply,f=Function.apply;e(e.S+e.F*!r(4)(function(){c(function(){})}),"Reflect",{apply:function(t,n,r){var e=o(t),i=u(r);return c?c(e,n,i):f.call(e,n,i)}})},function(t,n,r){var e=r(1),c=r(72),f=r(21),a=r(2),s=r(5),i=r(4),l=r(169),h=(r(3).Reflect||{}).construct,v=i(function(){function t(){}return!(h(function(){},[],t)instanceof t)}),p=!i(function(){h(function(){})});e(e.S+e.F*(v||p),"Reflect",{construct:function(t,n){f(t),a(n);var r=arguments.length<3?t:f(arguments[2]);if(p&&!v)return h(t,n,r);if(t==r){switch(n.length){case 0:return new t;case 1:return new t(n[0]);case 2:return new t(n[0],n[1]);case 3:return new t(n[0],n[1],n[2]);case 4:return new t(n[0],n[1],n[2],n[3])}var e=[null];return e.push.apply(e,n),new(l.apply(t,e))}var i=r.prototype,o=c(s(i)?i:Object.prototype),u=Function.apply.call(t,o,n);return s(u)?u:o}})},function(t,n,r){var e=r(11),i=r(1),o=r(2),u=r(53);i(i.S+i.F*r(4)(function(){Reflect.defineProperty(e.f({},1,{value:1}),1,{value:2})}),"Reflect",{defineProperty:function(t,n,r){o(t),n=u(n,!0),o(r);try{return e.f(t,n,r),!0}catch(t){return!1}}})},function(t,n,r){var e=r(1),i=r(31).f,o=r(2);e(e.S,"Reflect",{deleteProperty:function(t,n){var r=i(o(t),n);return!(r&&!r.configurable)&&delete t[n]}})},function(t,n,r){"use strict";var e=r(1),i=r(2),o=function(t){this._t=i(t),this._i=0;var n,r=this._k=[];for(n in t)r.push(n)};r(146)(o,"Object",function(){var t,n=this._k;do{if(this._i>=n.length)return{value:void 0,done:!0}}while(!((t=n[this._i++])in this._t));return{value:t,done:!1}}),e(e.S,"Reflect",{enumerate:function(t){return new o(t)}})},function(t,n,r){var e=r(31),i=r(1),o=r(2);i(i.S,"Reflect",{getOwnPropertyDescriptor:function(t,n){return e.f(o(t),n)}})},function(t,n,r){var e=r(1),i=r(32),o=r(2);e(e.S,"Reflect",{getPrototypeOf:function(t){return i(o(t))}})},function(t,n,r){var u=r(31),c=r(32),f=r(30),e=r(1),a=r(5),s=r(2);e(e.S,"Reflect",{get:function t(n,r){var e,i,o=arguments.length<3?n:arguments[2];return s(n)===o?n[r]:(e=u.f(n,r))?f(e,"value")?e.value:void 0!==e.get?e.get.call(o):void 0:a(i=c(n))?t(i,r,o):void 0}})},function(t,n,r){var e=r(1);e(e.S,"Reflect",{has:function(t,n){return n in t}})},function(t,n,r){var e=r(1),i=r(2),o=Object.isExtensible;e(e.S,"Reflect",{isExtensible:function(t){return i(t),!o||o(t)}})},function(t,n,r){var e=r(1);e(e.S,"Reflect",{ownKeys:r(187)})},function(t,n,r){var e=r(1),i=r(2),o=Object.preventExtensions;e(e.S,"Reflect",{preventExtensions:function(t){i(t);try{return o&&o(t),!0}catch(t){return!1}}})},function(t,n,r){var e=r(1),i=r(153);i&&e(e.S,"Reflect",{setPrototypeOf:function(t,n){i.check(t,n);try{return i.set(t,n),!0}catch(t){return!1}}})},function(t,n,r){var f=r(11),a=r(31),s=r(32),l=r(30),e=r(1),h=r(75),v=r(2),p=r(5);e(e.S,"Reflect",{set:function t(n,r,e){var i,o,u=arguments.length<4?n:arguments[3],c=a.f(v(n),r);if(!c){if(p(o=s(n)))return t(o,r,e,u);c=h(0)}if(l(c,"value")){if(!1===c.writable||!p(u))return!1;if(i=a.f(u,r)){if(i.get||i.set||!1===i.writable)return!1;i.value=e,f.f(u,r,i)}else f.f(u,r,h(0,e));return!0}return void 0!==c.set&&(c.set.call(u,e),!0)}})},function(t,n,r){var e=r(3),o=r(144),i=r(11).f,u=r(73).f,c=r(124),f=r(115),a=e.RegExp,s=a,l=a.prototype,h=/a/g,v=/a/g,p=new a(h)!==h;if(r(10)&&(!p||r(4)(function(){return v[r(7)("match")]=!1,a(h)!=h||a(v)==v||"/a/i"!=a(h,"i")}))){a=function(t,n){var r=this instanceof a,e=c(t),i=void 0===n;return!r&&e&&t.constructor===a&&i?t:o(p?new s(e&&!i?t.source:t,n):s((e=t instanceof a)?t.source:t,e&&i?f.call(t):n),r?this:l,a)};for(var d=function(n){n in a||i(a,n,{configurable:!0,get:function(){return s[n]},set:function(t){s[n]=t}})},y=u(s),g=0;y.length>g;)d(y[g++]);(l.constructor=a).prototype=l,r(27)(e,"RegExp",a)}r(77)("RegExp")},function(t,n,r){"use strict";var l=r(2),h=r(8),v=r(136),p=r(128);r(122)("match",1,function(e,i,a,s){return[function(t){var n=e(this),r=null==t?void 0:t[i];return void 0!==r?r.call(t,n):new RegExp(t)[i](String(n))},function(t){var n=s(a,t,this);if(n.done)return n.value;var r=l(t),e=String(this);if(!r.global)return p(r,e);for(var i,o=r.unicode,u=[],c=r.lastIndex=0;null!==(i=p(r,e));){var f=String(i[0]);""===(u[c]=f)&&(r.lastIndex=v(e,h(r.lastIndex),o)),c++}return 0===c?null:u}]})},function(t,n,r){"use strict";var O=r(2),e=r(17),E=r(8),M=r(49),P=r(136),j=r(128),F=Math.max,A=Math.min,h=Math.floor,v=/\$([$&`']|\d\d?|<[^>]*>)/g,p=/\$([$&`']|\d\d?)/g;r(122)("replace",2,function(i,o,S,w){function _(o,u,c,f,a,t){var s=c+o.length,l=f.length,n=p;return void 0!==a&&(a=e(a),n=v),S.call(t,n,function(t,n){var r;switch(n.charAt(0)){case"$":return"$";case"&":return o;case"`":return u.slice(0,c);case"'":return u.slice(s);case"<":r=a[n.slice(1,-1)];break;default:var e=+n;if(0===e)return t;if(l<e){var i=h(e/10);return 0===i?t:i<=l?void 0===f[i-1]?n.charAt(1):f[i-1]+n.charAt(1):t}r=f[e-1]}return void 0===r?"":r})}return[function(t,n){var r=i(this),e=null==t?void 0:t[o];return void 0!==e?e.call(t,r,n):S.call(String(r),t,n)},function(t,n){var r=w(S,t,this,n);if(r.done)return r.value;var e=O(t),i=String(this),o="function"==typeof n;o||(n=String(n));var u,c=e.global;if(c){var f=e.unicode;e.lastIndex=0}for(var a=[];;){var s=j(e,i);if(null===s)break;if(a.push(s),!c)break;""===String(s[0])&&(e.lastIndex=P(i,E(e.lastIndex),f))}for(var l="",h=0,v=0;v<a.length;v++){s=a[v];for(var p=String(s[0]),d=F(A(M(s.index),i.length),0),y=[],g=1;g<s.length;g++)y.push(void 0===(u=s[g])?u:String(u));var b=s.groups;if(o){var x=[p].concat(y,d,i);void 0!==b&&x.push(b);var m=String(n.apply(void 0,x))}else m=_(p,i,d,y,b,n);h<=d&&(l+=i.slice(h,d)+m,h=d+p.length)}return l+i.slice(h)}]})},function(t,n,r){"use strict";var f=r(2),a=r(192),s=r(128);r(122)("search",1,function(e,i,u,c){return[function(t){var n=e(this),r=null==t?void 0:t[i];return void 0!==r?r.call(t,n):new RegExp(t)[i](String(n))},function(t){var n=c(u,t,this);if(n.done)return n.value;var r=f(t),e=String(this),i=r.lastIndex;a(i,0)||(r.lastIndex=0);var o=s(r,e);return a(r.lastIndex,i)||(r.lastIndex=i),null===o?-1:o.index}]})},function(t,n,r){"use strict";var l=r(124),x=r(2),m=r(119),S=r(136),w=r(8),_=r(128),h=r(152),e=r(4),O=Math.min,v=[].push,u="split",p="length",d="lastIndex",E=4294967295,M=!e(function(){RegExp(E,"y")});r(122)("split",2,function(i,o,y,g){var b;return b="c"=="abbc"[u](/(b)*/)[1]||4!="test"[u](/(?:)/,-1)[p]||2!="ab"[u](/(?:ab)*/)[p]||4!="."[u](/(.?)(.?)/)[p]||1<"."[u](/()()/)[p]||""[u](/.?/)[p]?function(t,n){var r=String(this);if(void 0===t&&0===n)return[];if(!l(t))return y.call(r,t,n);for(var e,i,o,u=[],c=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),f=0,a=void 0===n?E:n>>>0,s=new RegExp(t.source,c+"g");(e=h.call(s,r))&&!(f<(i=s[d])&&(u.push(r.slice(f,e.index)),1<e[p]&&e.index<r[p]&&v.apply(u,e.slice(1)),o=e[0][p],f=i,u[p]>=a));)s[d]===e.index&&s[d]++;return f===r[p]?!o&&s.test("")||u.push(""):u.push(r.slice(f)),u[p]>a?u.slice(0,a):u}:"0"[u](void 0,0)[p]?function(t,n){return void 0===t&&0===n?[]:y.call(this,t,n)}:y,[function(t,n){var r=i(this),e=null==t?void 0:t[o];return void 0!==e?e.call(t,r,n):b.call(String(r),t,n)},function(t,n){var r=g(b,t,this,n,b!==y);if(r.done)return r.value;var e=x(t),i=String(this),o=m(e,RegExp),u=e.unicode,c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(M?"y":"g"),f=new o(M?e:"^(?:"+e.source+")",c),a=void 0===n?E:n>>>0;if(0===a)return[];if(0===i.length)return null===_(f,i)?[i]:[];for(var s=0,l=0,h=[];l<i.length;){f.lastIndex=M?l:0;var v,p=_(f,M?i:i.slice(l));if(null===p||(v=O(w(f.lastIndex+(M?0:l)),i.length))===s)l=S(i,l,u);else{if(h.push(i.slice(s,l)),h.length===a)return h;for(var d=1;d<=p.length-1;d++)if(h.push(p[d]),h.length===a)return h;l=s=v}}return h.push(i.slice(s)),h}]})},function(t,n,r){"use strict";r(198);var e=r(2),i=r(115),o=r(10),u="toString",c=/./[u],f=function(t){r(27)(RegExp.prototype,u,t,!0)};r(4)(function(){return"/a/b"!=c.call({source:"a",flags:"b"})})?f(function(){var t=e(this);return"/".concat(t.source,"/","flags"in t?t.flags:!o&&t instanceof RegExp?i.call(t):void 0)}):c.name!=u&&f(function(){return c.call(this)})},function(t,n,r){"use strict";r(28)("anchor",function(n){return function(t){return n(this,"a","name",t)}})},function(t,n,r){"use strict";r(28)("big",function(t){return function(){return t(this,"big","","")}})},function(t,n,r){"use strict";r(28)("blink",function(t){return function(){return t(this,"blink","","")}})},function(t,n,r){"use strict";r(28)("bold",function(t){return function(){return t(this,"b","","")}})},function(t,n,r){"use strict";var e=r(1),i=r(131)(!1);e(e.P,"String",{codePointAt:function(t){return i(this,t)}})},function(t,n,r){"use strict";var e=r(1),u=r(8),c=r(155),f="endsWith",a=""[f];e(e.P+e.F*r(142)(f),"String",{endsWith:function(t){var n=c(this,t,f),r=1<arguments.length?arguments[1]:void 0,e=u(n.length),i=void 0===r?e:Math.min(u(r),e),o=String(t);return a?a.call(n,o,i):n.slice(i-o.length,i)===o}})},function(t,n,r){"use strict";r(28)("fixed",function(t){return function(){return t(this,"tt","","")}})},function(t,n,r){"use strict";r(28)("fontcolor",function(n){return function(t){return n(this,"font","color",t)}})},function(t,n,r){"use strict";r(28)("fontsize",function(n){return function(t){return n(this,"font","size",t)}})},function(t,n,r){var e=r(1),o=r(78),u=String.fromCharCode,i=String.fromCodePoint;e(e.S+e.F*(!!i&&1!=i.length),"String",{fromCodePoint:function(t){for(var n,r=[],e=arguments.length,i=0;i<e;){if(n=+arguments[i++],o(n,1114111)!==n)throw RangeError(n+" is not a valid code point");r.push(n<65536?u(n):u(55296+((n-=65536)>>10),n%1024+56320))}return r.join("")}})},function(t,n,r){"use strict";var e=r(1),i=r(155);e(e.P+e.F*r(142)("includes"),"String",{includes:function(t){return!!~i(this,t,"includes").indexOf(t,1<arguments.length?arguments[1]:void 0)}})},function(t,n,r){"use strict";r(28)("italics",function(t){return function(){return t(this,"i","","")}})},function(t,n,r){"use strict";var e=r(131)(!0);r(147)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,n=this._t,r=this._i;return r>=n.length?{value:void 0,done:!0}:(t=e(n,r),this._i+=t.length,{value:t,done:!1})})},function(t,n,r){"use strict";r(28)("link",function(n){return function(t){return n(this,"a","href",t)}})},function(t,n,r){var e=r(1),u=r(33),c=r(8);e(e.S,"String",{raw:function(t){for(var n=u(t.raw),r=c(n.length),e=arguments.length,i=[],o=0;o<r;)i.push(String(n[o++])),o<e&&i.push(String(arguments[o]));return i.join("")}})},function(t,n,r){var e=r(1);e(e.P,"String",{repeat:r(156)})},function(t,n,r){"use strict";r(28)("small",function(t){return function(){return t(this,"small","","")}})},function(t,n,r){"use strict";var e=r(1),i=r(8),o=r(155),u="startsWith",c=""[u];e(e.P+e.F*r(142)(u),"String",{startsWith:function(t){var n=o(this,t,u),r=i(Math.min(1<arguments.length?arguments[1]:void 0,n.length)),e=String(t);return c?c.call(n,e,r):n.slice(r,r+e.length)===e}})},function(t,n,r){"use strict";r(28)("strike",function(t){return function(){return t(this,"strike","","")}})},function(t,n,r){"use strict";r(28)("sub",function(t){return function(){return t(this,"sub","","")}})},function(t,n,r){"use strict";r(28)("sup",function(t){return function(){return t(this,"sup","","")}})},function(t,n,r){"use strict";r(84)("trim",function(t){return function(){return t(this,3)}})},function(t,n,r){"use strict";var e=r(3),u=r(30),i=r(10),o=r(1),c=r(27),f=r(69).KEY,a=r(4),s=r(118),l=r(83),h=r(79),v=r(7),p=r(195),d=r(160),y=r(218),g=r(123),b=r(2),x=r(5),m=r(17),S=r(33),w=r(53),_=r(75),O=r(72),E=r(184),M=r(31),P=r(127),j=r(11),F=r(74),A=M.f,I=j.f,L=E.f,N=e.Symbol,T=e.JSON,k=T&&T.stringify,R="prototype",C=v("_hidden"),D=v("toPrimitive"),G={}.propertyIsEnumerable,W=s("symbol-registry"),U=s("symbols"),V=s("op-symbols"),B=Object[R],q="function"==typeof N&&!!P.f,z=e.QObject,K=!z||!z[R]||!z[R].findChild,H=i&&a(function(){return 7!=O(I({},"a",{get:function(){return I(this,"a",{value:7}).a}})).a})?function(t,n,r){var e=A(B,n);e&&delete B[n],I(t,n,r),e&&t!==B&&I(B,n,e)}:I,J=function(t){var n=U[t]=O(N[R]);return n._k=t,n},$=q&&"symbol"==typeof N.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof N},Y=function(t,n,r){return t===B&&Y(V,n,r),b(t),n=w(n,!0),b(r),u(U,n)?(r.enumerable?(u(t,C)&&t[C][n]&&(t[C][n]=!1),r=O(r,{enumerable:_(0,!1)})):(u(t,C)||I(t,C,_(1,{})),t[C][n]=!0),H(t,n,r)):I(t,n,r)},X=function(t,n){b(t);for(var r,e=y(n=S(n)),i=0,o=e.length;i<o;)Y(t,r=e[i++],n[r]);return t},Q=function(t){var n=G.call(this,t=w(t,!0));return!(this===B&&u(U,t)&&!u(V,t))&&(!(n||!u(this,t)||!u(U,t)||u(this,C)&&this[C][t])||n)},Z=function(t,n){if(t=S(t),n=w(n,!0),t!==B||!u(U,n)||u(V,n)){var r=A(t,n);return!r||!u(U,n)||u(t,C)&&t[C][n]||(r.enumerable=!0),r}},tt=function(t){for(var n,r=L(S(t)),e=[],i=0;r.length>i;)u(U,n=r[i++])||n==C||n==f||e.push(n);return e},nt=function(t){for(var n,r=t===B,e=L(r?V:S(t)),i=[],o=0;e.length>o;)!u(U,n=e[o++])||r&&!u(B,n)||i.push(U[n]);return i};q||(c((N=function(){if(this instanceof N)throw TypeError("Symbol is not a constructor!");var n=h(0<arguments.length?arguments[0]:void 0),r=function(t){this===B&&r.call(V,t),u(this,C)&&u(this[C],n)&&(this[C][n]=!1),H(this,n,_(1,t))};return i&&K&&H(B,n,{configurable:!0,set:r}),J(n)})[R],"toString",function(){return this._k}),M.f=Z,j.f=Y,r(73).f=E.f=tt,r(117).f=Q,P.f=nt,i&&!r(68)&&c(B,"propertyIsEnumerable",Q,!0),p.f=function(t){return J(v(t))}),o(o.G+o.W+o.F*!q,{Symbol:N});for(var rt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),et=0;rt.length>et;)v(rt[et++]);for(var it=F(v.store),ot=0;it.length>ot;)d(it[ot++]);o(o.S+o.F*!q,"Symbol",{for:function(t){return u(W,t+="")?W[t]:W[t]=N(t)},keyFor:function(t){if(!$(t))throw TypeError(t+" is not a symbol!");for(var n in W)if(W[n]===t)return n},useSetter:function(){K=!0},useSimple:function(){K=!1}}),o(o.S+o.F*!q,"Object",{create:function(t,n){return void 0===n?O(t):X(O(t),n)},defineProperty:Y,defineProperties:X,getOwnPropertyDescriptor:Z,getOwnPropertyNames:tt,getOwnPropertySymbols:nt});var ut=a(function(){P.f(1)});o(o.S+o.F*ut,"Object",{getOwnPropertySymbols:function(t){return P.f(m(t))}}),T&&o(o.S+o.F*(!q||a(function(){var t=N();return"[null]"!=k([t])||"{}"!=k({a:t})||"{}"!=k(Object(t))})),"JSON",{stringify:function(t){for(var n,r,e=[t],i=1;arguments.length>i;)e.push(arguments[i++]);if(r=n=e[1],(x(n)||void 0!==t)&&!$(t))return g(n)||(n=function(t,n){if("function"==typeof r&&(n=r.call(this,t,n)),!$(n))return n}),e[1]=n,k.apply(T,e)}}),N[R][D]||r(26)(N[R],D,N[R].valueOf),l(N,"Symbol"),l(Math,"Math",!0),l(e.JSON,"JSON",!0)},function(t,n,r){"use strict";var e=r(1),i=r(132),o=r(159),a=r(2),s=r(78),l=r(8),u=r(5),c=r(3).ArrayBuffer,h=r(119),v=o.ArrayBuffer,p=o.DataView,f=i.ABV&&c.isView,d=v.prototype.slice,y=i.VIEW,g="ArrayBuffer";e(e.G+e.W+e.F*(c!==v),{ArrayBuffer:v}),e(e.S+e.F*!i.CONSTR,g,{isView:function(t){return f&&f(t)||u(t)&&y in t}}),e(e.P+e.U+e.F*r(4)(function(){return!new v(2).slice(1,void 0).byteLength}),g,{slice:function(t,n){if(void 0!==d&&void 0===n)return d.call(a(this),t);for(var r=a(this).byteLength,e=s(t,r),i=s(void 0===n?r:n,r),o=new(h(this,v))(l(i-e)),u=new p(this),c=new p(o),f=0;e<i;)c.setUint8(f++,u.getUint8(e++));return o}}),r(77)(g)},function(t,n,r){var e=r(1);e(e.G+e.W+e.F*!r(132).ABV,{DataView:r(159).DataView})},function(t,n,r){r(57)("Float32",4,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(t,n,r){r(57)("Float64",8,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(t,n,r){r(57)("Int16",2,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(t,n,r){r(57)("Int32",4,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(t,n,r){r(57)("Int8",1,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(t,n,r){r(57)("Uint16",2,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(t,n,r){r(57)("Uint32",4,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(t,n,r){r(57)("Uint8",1,function(e){return function(t,n,r){return e(this,t,n,r)}})},function(t,n,r){r(57)("Uint8",1,function(e){return function(t,n,r){return e(this,t,n,r)}},!0)},function(t,n,r){"use strict";var e=r(172),i=r(80);r(121)("WeakSet",function(t){return function(){return t(this,0<arguments.length?arguments[0]:void 0)}},{add:function(t){return e.def(i(this,"WeakSet"),t,!0)}},e,!1,!0)},function(t,n,r){"use strict";var e=r(1),i=r(173),o=r(17),u=r(8),c=r(21),f=r(138);e(e.P,"Array",{flatMap:function(t){var n,r,e=o(this);return c(t),n=u(e.length),r=f(e,0),i(r,e,e,n,0,1,t,arguments[1]),r}}),r(67)("flatMap")},function(t,n,r){"use strict";var e=r(1),i=r(173),o=r(17),u=r(8),c=r(49),f=r(138);e(e.P,"Array",{flatten:function(){var t=arguments[0],n=o(this),r=u(n.length),e=f(n,0);return i(e,n,n,r,0,void 0===t?1:c(t)),e}}),r(67)("flatten")},function(t,n,r){"use strict";var e=r(1),i=r(120)(!0);e(e.P,"Array",{includes:function(t){return i(this,t,1<arguments.length?arguments[1]:void 0)}}),r(67)("includes")},function(t,n,r){var e=r(1),i=r(150)(),o=r(3).process,u="process"==r(45)(o);e(e.G,{asap:function(t){var n=u&&o.domain;i(n?n.bind(t):t)}})},function(t,n,r){var e=r(1),i=r(45);e(e.S,"Error",{isError:function(t){return"Error"===i(t)}})},function(t,n,r){var e=r(1);e(e.G,{global:r(3)})},function(t,n,r){r(129)("Map")},function(t,n,r){r(130)("Map")},function(t,n,r){var e=r(1);e(e.P+e.R,"Map",{toJSON:r(171)("Map")})},function(t,n,r){var e=r(1);e(e.S,"Math",{clamp:function(t,n,r){return Math.min(r,Math.max(n,t))}})},function(t,n,r){var e=r(1);e(e.S,"Math",{DEG_PER_RAD:Math.PI/180})},function(t,n,r){var e=r(1),i=180/Math.PI;e(e.S,"Math",{degrees:function(t){return t*i}})},function(t,n,r){var e=r(1),o=r(181),u=r(179);e(e.S,"Math",{fscale:function(t,n,r,e,i){return u(o(t,n,r,e,i))}})},function(t,n,r){var e=r(1);e(e.S,"Math",{iaddh:function(t,n,r,e){var i=t>>>0,o=r>>>0;return(n>>>0)+(e>>>0)+((i&o|(i|o)&~(i+o>>>0))>>>31)|0}})},function(t,n,r){var e=r(1);e(e.S,"Math",{imulh:function(t,n){var r=+t,e=+n,i=65535&r,o=65535&e,u=r>>16,c=e>>16,f=(u*o>>>0)+(i*o>>>16);return u*c+(f>>16)+((i*c>>>0)+(65535&f)>>16)}})},function(t,n,r){var e=r(1);e(e.S,"Math",{isubh:function(t,n,r,e){var i=t>>>0,o=r>>>0;return(n>>>0)-(e>>>0)-((~i&o|~(i^o)&i-o>>>0)>>>31)|0}})},function(t,n,r){var e=r(1);e(e.S,"Math",{RAD_PER_DEG:180/Math.PI})},function(t,n,r){var e=r(1),i=Math.PI/180;e(e.S,"Math",{radians:function(t){return t*i}})},function(t,n,r){var e=r(1);e(e.S,"Math",{scale:r(181)})},function(t,n,r){var e=r(1);e(e.S,"Math",{signbit:function(t){return(t=+t)!=t?t:0==t?1/t==1/0:0<t}})},function(t,n,r){var e=r(1);e(e.S,"Math",{umulh:function(t,n){var r=+t,e=+n,i=65535&r,o=65535&e,u=r>>>16,c=e>>>16,f=(u*o>>>0)+(i*o>>>16);return u*c+(f>>>16)+((i*c>>>0)+(65535&f)>>>16)}})},function(t,n,r){"use strict";var e=r(1),i=r(17),o=r(21),u=r(11);r(10)&&e(e.P+r(126),"Object",{__defineGetter__:function(t,n){u.f(i(this),t,{get:o(n),enumerable:!0,configurable:!0})}})},function(t,n,r){"use strict";var e=r(1),i=r(17),o=r(21),u=r(11);r(10)&&e(e.P+r(126),"Object",{__defineSetter__:function(t,n){u.f(i(this),t,{set:o(n),enumerable:!0,configurable:!0})}})},function(t,n,r){var e=r(1),i=r(186)(!0);e(e.S,"Object",{entries:function(t){return i(t)}})},function(t,n,r){var e=r(1),f=r(187),a=r(33),s=r(31),l=r(139);e(e.S,"Object",{getOwnPropertyDescriptors:function(t){for(var n,r,e=a(t),i=s.f,o=f(e),u={},c=0;o.length>c;)void 0!==(r=i(e,n=o[c++]))&&l(u,n,r);return u}})},function(t,n,r){"use strict";var e=r(1),i=r(17),o=r(53),u=r(32),c=r(31).f;r(10)&&e(e.P+r(126),"Object",{__lookupGetter__:function(t){var n,r=i(this),e=o(t,!0);do{if(n=c(r,e))return n.get}while(r=u(r))}})},function(t,n,r){"use strict";var e=r(1),i=r(17),o=r(53),u=r(32),c=r(31).f;r(10)&&e(e.P+r(126),"Object",{__lookupSetter__:function(t){var n,r=i(this),e=o(t,!0);do{if(n=c(r,e))return n.set}while(r=u(r))}})},function(t,n,r){var e=r(1),i=r(186)(!1);e(e.S,"Object",{values:function(t){return i(t)}})},function(t,n,r){"use strict";var e=r(1),o=r(3),u=r(46),i=r(150)(),c=r(7)("observable"),f=r(21),a=r(2),s=r(70),l=r(76),h=r(26),v=r(71),p=v.RETURN,d=function(t){return null==t?void 0:f(t)},y=function(t){var n=t._c;n&&(t._c=void 0,n())},g=function(t){return void 0===t._o},b=function(t){g(t)||(t._o=void 0,y(t))},x=function(t,n){a(t),this._c=void 0,this._o=t,t=new m(this);try{var r=n(t),e=r;null!=r&&("function"==typeof r.unsubscribe?r=function(){e.unsubscribe()}:f(r),this._c=r)}catch(n){return void t.error(n)}g(this)&&y(this)};x.prototype=l({},{unsubscribe:function(){b(this)}});var m=function(t){this._s=t};m.prototype=l({},{next:function(t){var n=this._s;if(!g(n)){var r=n._o;try{var e=d(r.next);if(e)return e.call(r,t)}catch(t){try{b(n)}finally{throw t}}}},error:function(t){var n=this._s;if(g(n))throw t;var r=n._o;n._o=void 0;try{var e=d(r.error);if(!e)throw t;t=e.call(r,t)}catch(t){try{y(n)}finally{throw t}}return y(n),t},complete:function(t){var n=this._s;if(!g(n)){var r=n._o;n._o=void 0;try{var e=d(r.complete);t=e?e.call(r,t):void 0}catch(t){try{y(n)}finally{throw t}}return y(n),t}}});var S=function(t){s(this,S,"Observable","_f")._f=f(t)};l(S.prototype,{subscribe:function(t){return new x(t,this._f)},forEach:function(e){var i=this;return new(u.Promise||o.Promise)(function(t,n){f(e);var r=i.subscribe({next:function(t){try{return e(t)}catch(t){n(t),r.unsubscribe()}},error:n,complete:t})})}}),l(S,{from:function(t){var n="function"==typeof this?this:S,r=d(a(t)[c]);if(r){var e=a(r.call(t));return e.constructor===n?e:new n(function(t){return e.subscribe(t)})}return new n(function(n){var r=!1;return i(function(){if(!r){try{if(v(t,!1,function(t){if(n.next(t),r)return p})===p)return}catch(t){if(r)throw t;return void n.error(t)}n.complete()}}),function(){r=!0}})},of:function(){for(var t=0,n=arguments.length,e=new Array(n);t<n;)e[t]=arguments[t++];return new("function"==typeof this?this:S)(function(n){var r=!1;return i(function(){if(!r){for(var t=0;t<e.length;++t)if(n.next(e[t]),r)return;n.complete()}}),function(){r=!0}})}}),h(S.prototype,c,function(){return this}),e(e.G,{Observable:S}),r(77)("Observable")},function(t,n,r){"use strict";var e=r(1),i=r(46),o=r(3),u=r(119),c=r(191);e(e.P+e.R,"Promise",{finally:function(n){var r=u(this,i.Promise||o.Promise),t="function"==typeof n;return this.then(t?function(t){return c(r,n()).then(function(){return t})}:n,t?function(t){return c(r,n()).then(function(){throw t})}:n)}})},function(t,n,r){"use strict";var e=r(1),i=r(151),o=r(190);e(e.S,"Promise",{try:function(t){var n=i.f(this),r=o(t);return(r.e?n.reject:n.resolve)(r.v),n.promise}})},function(t,n,r){var e=r(56),i=r(2),o=e.key,u=e.set;e.exp({defineMetadata:function(t,n,r,e){u(t,n,i(r),o(e))}})},function(t,n,r){var e=r(56),o=r(2),u=e.key,c=e.map,f=e.store;e.exp({deleteMetadata:function(t,n){var r=arguments.length<3?void 0:u(arguments[2]),e=c(o(n),r,!1);if(void 0===e||!e.delete(t))return!1;if(e.size)return!0;var i=f.get(n);return i.delete(r),!!i.size||f.delete(n)}})},function(t,n,r){var o=r(199),u=r(167),e=r(56),i=r(2),c=r(32),f=e.keys,a=e.key,s=function(t,n){var r=f(t,n),e=c(t);if(null===e)return r;var i=s(e,n);return i.length?r.length?u(new o(r.concat(i))):i:r};e.exp({getMetadataKeys:function(t){return s(i(t),arguments.length<2?void 0:a(arguments[1]))}})},function(t,n,r){var e=r(56),i=r(2),o=r(32),u=e.has,c=e.get,f=e.key,a=function(t,n,r){if(u(t,n,r))return c(t,n,r);var e=o(n);return null!==e?a(t,e,r):void 0};e.exp({getMetadata:function(t,n){return a(t,i(n),arguments.length<3?void 0:f(arguments[2]))}})},function(t,n,r){var e=r(56),i=r(2),o=e.keys,u=e.key;e.exp({getOwnMetadataKeys:function(t){return o(i(t),arguments.length<2?void 0:u(arguments[1]))}})},function(t,n,r){var e=r(56),i=r(2),o=e.get,u=e.key;e.exp({getOwnMetadata:function(t,n){return o(t,i(n),arguments.length<3?void 0:u(arguments[2]))}})},function(t,n,r){var e=r(56),i=r(2),o=r(32),u=e.has,c=e.key,f=function(t,n,r){if(u(t,n,r))return!0;var e=o(n);return null!==e&&f(t,e,r)};e.exp({hasMetadata:function(t,n){return f(t,i(n),arguments.length<3?void 0:c(arguments[2]))}})},function(t,n,r){var e=r(56),i=r(2),o=e.has,u=e.key;e.exp({hasOwnMetadata:function(t,n){return o(t,i(n),arguments.length<3?void 0:u(arguments[2]))}})},function(t,n,r){var e=r(56),i=r(2),o=r(21),u=e.key,c=e.set;e.exp({metadata:function(r,e){return function(t,n){c(r,e,(void 0!==n?i:o)(t),u(n))}}})},function(t,n,r){r(129)("Set")},function(t,n,r){r(130)("Set")},function(t,n,r){var e=r(1);e(e.P+e.R,"Set",{toJSON:r(171)("Set")})},function(t,n,r){"use strict";var e=r(1),i=r(131)(!0);e(e.P,"String",{at:function(t){return i(this,t)}})},function(t,n,r){"use strict";var e=r(1),i=r(51),o=r(8),u=r(124),c=r(115),f=RegExp.prototype,a=function(t,n){this._r=t,this._s=n};r(146)(a,"RegExp String",function(){var t=this._r.exec(this._s);return{value:t,done:null===t}}),e(e.P,"String",{matchAll:function(t){if(i(this),!u(t))throw TypeError(t+" is not a regexp!");var n=String(this),r="flags"in f?String(t.flags):c.call(t),e=new RegExp(t.source,~r.indexOf("g")?r:"g"+r);return e.lastIndex=o(t.lastIndex),new a(e,n)}})},function(t,n,r){"use strict";var e=r(1),i=r(193),o=r(133),u=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);e(e.P+e.F*u,"String",{padEnd:function(t){return i(this,t,1<arguments.length?arguments[1]:void 0,!1)}})},function(t,n,r){"use strict";var e=r(1),i=r(193),o=r(133),u=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(o);e(e.P+e.F*u,"String",{padStart:function(t){return i(this,t,1<arguments.length?arguments[1]:void 0,!0)}})},function(t,n,r){"use strict";r(84)("trimLeft",function(t){return function(){return t(this,1)}},"trimStart")},function(t,n,r){"use strict";r(84)("trimRight",function(t){return function(){return t(this,2)}},"trimEnd")},function(t,n,r){r(160)("asyncIterator")},function(t,n,r){r(160)("observable")},function(t,n,r){var e=r(1);e(e.S,"System",{global:r(3)})},function(t,n,r){r(129)("WeakMap")},function(t,n,r){r(130)("WeakMap")},function(t,n,r){r(129)("WeakSet")},function(t,n,r){r(130)("WeakSet")},function(t,n,r){for(var e=r(162),i=r(74),o=r(27),u=r(3),c=r(26),f=r(82),a=r(7),s=a("iterator"),l=a("toStringTag"),h=f.Array,v={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},p=i(v),d=0;d<p.length;d++){var y,g=p[d],b=v[g],x=u[g],m=x&&x.prototype;if(m&&(m[s]||c(m,s,h),m[l]||c(m,l,g),f[g]=h,b))for(y in e)m[y]||o(m,y,e[y],!0)}},function(t,n,r){var e=r(1),i=r(158);e(e.G+e.B,{setImmediate:i.set,clearImmediate:i.clear})},function(t,n,r){var e=r(3),i=r(1),o=r(133),u=[].slice,c=/MSIE .\./.test(o),f=function(i){return function(t,n){var r=2<arguments.length,e=!!r&&u.call(arguments,2);return i(r?function(){("function"==typeof t?t:Function(t)).apply(this,e)}:t,n)}};i(i.G+i.B+i.F*c,{setTimeout:f(e.setTimeout),setInterval:f(e.setInterval)})},function(t,n,r){r(341),r(280),r(282),r(281),r(284),r(286),r(291),r(285),r(283),r(293),r(292),r(288),r(289),r(287),r(279),r(290),r(294),r(295),r(247),r(249),r(248),r(297),r(296),r(267),r(277),r(278),r(268),r(269),r(270),r(271),r(272),r(273),r(274),r(275),r(276),r(250),r(251),r(252),r(253),r(254),r(255),r(256),r(257),r(258),r(259),r(260),r(261),r(262),r(263),r(264),r(265),r(266),r(328),r(333),r(340),r(331),r(323),r(324),r(329),r(334),r(336),r(319),r(320),r(321),r(322),r(325),r(326),r(327),r(330),r(332),r(335),r(337),r(338),r(339),r(242),r(244),r(243),r(246),r(245),r(231),r(229),r(235),r(232),r(238),r(240),r(228),r(234),r(225),r(239),r(223),r(237),r(236),r(230),r(233),r(222),r(224),r(227),r(226),r(241),r(162),r(313),r(197),r(318),r(198),r(314),r(315),r(316),r(317),r(298),r(196),r(199),r(200),r(353),r(342),r(343),r(348),r(351),r(352),r(346),r(349),r(347),r(350),r(344),r(345),r(299),r(300),r(301),r(302),r(303),r(306),r(304),r(305),r(307),r(308),r(309),r(310),r(312),r(311),r(356),r(354),r(355),r(397),r(400),r(399),r(401),r(402),r(398),r(403),r(404),r(378),r(381),r(377),r(375),r(376),r(379),r(380),r(362),r(396),r(361),r(395),r(407),r(409),r(360),r(394),r(406),r(408),r(359),r(405),r(358),r(363),r(364),r(365),r(366),r(367),r(369),r(368),r(370),r(371),r(372),r(374),r(373),r(383),r(384),r(385),r(386),r(388),r(387),r(390),r(389),r(391),r(392),r(393),r(357),r(382),r(412),r(411),r(410),t.exports=r(46)},function(t,n){t.exports=function(t,n){if("string"==typeof n)return t.insertAdjacentHTML("afterend",n);var r=t.nextSibling;return r?t.parentNode.insertBefore(n,r):t.parentNode.appendChild(n)}}])</script><script src="/./main.e9e0ac.js"></script><script>!function(){var e,t;e="/slider.c27416.js",t=document.createElement("script"),document.getElementsByTagName("body")[0].appendChild(t),t.setAttribute("src",e)}()</script>


<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
      tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
  });

  MathJax.Hub.Queue(function() {
      var all = MathJax.Hub.getAllJax(), i;
      for(i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
      }
  });
</script>

<script src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>



<!--  -->


    
<div class="tools-col" q-class="show:isShow,hide:isShow|isFalse" q-on="click:stop(e)">
  <div class="tools-nav header-menu">
    
    
      
      
      
    
      
      
      
    
    

    <ul style="width: 70%">
    
    
      
      <li style="width: 50%" q-on="click: openSlider(e, 'innerArchive')"><a href="javascript:void(0)" q-class="active:innerArchive">所有文章</a></li>
      
        
      
      <li style="width: 50%" q-on="click: openSlider(e, 'friends')"><a href="javascript:void(0)" q-class="active:friends">工具</a></li>
      
        
    </ul>
  </div>
  <div class="tools-wrap">
    
    	<section class="tools-section tools-section-all" q-show="innerArchive">
        <div class="search-wrap">
          <input class="search-ipt" q-model="search" type="text" placeholder="find something…">
          <i class="icon-search icon" q-show="search|isEmptyStr"></i>
          <i class="icon-close icon" q-show="search|isNotEmptyStr" q-on="click:clearChose(e)"></i>
        </div>
        <div class="widget tagcloud search-tag">
          <p class="search-tag-wording">tag:</p>
          <label class="search-switch">
            <input type="checkbox" q-on="click:toggleTag(e)" q-attr="checked:showTags">
          </label>
          <ul class="article-tag-list" q-show="showTags">
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">生活</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">JavaSE</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">Android</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">JVM</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">JavaWeb</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">异步</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">网络安全</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">设计模式</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">自定义UI</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">模板引擎</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">前端</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">组件通信</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">C/C++</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">索引</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">MySQL</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">Nginx</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">JUC</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">Docker</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">Linux</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">计算机网络</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">上传下载</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">Git</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">JavaEE</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">SpringCloud</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">消息通信</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">RPC</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">Golang</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">Gradle</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">非对称加密</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">ORM框架</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">IDEA</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">SpringBoot</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">文件系统</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">GC</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">模块化</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">交互式</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">Stream</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">Lambda</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">字符串</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">Jenkins</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">Jsoup</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">Http	Client</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">vim</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">LRUCache</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">异常处理</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">存储</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">文件下载</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">Mac</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">Windows</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">openCV</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">NIO</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">排序算法</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">Python</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">集群</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">微服务</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">SpringMVC</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">REST</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">Redis</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">缓存中间件</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">RabbitMQ</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">服务解耦</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">SSH</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">负载均衡</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">SQLite</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">SpringCore</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">权限</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">配置中心</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">UML</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">XML</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">多线程</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">Maven</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">Chrome</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">单例模式</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">压力测试</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">概率论</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">博客</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">分布式</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">哈希</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">栈</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">回溯</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">Netty</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">高性能网络</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">序列化</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">流媒体</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color2">堆</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">二叉树</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">面向对象</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">Vue</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">ElementUI</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">IPC通信</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">软件工程</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">Protobuf</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color1">观察者模式</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">线程池</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">动态扩容</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color4">高可用</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">Hash</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color5">集合框架</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">链表</a>
              </li>
             
              <li class="article-tag-list-item">
                <a href="javascript:void(0)" class="js-tag color3">IO</a>
              </li>
            
            <div class="clearfix"></div>
          </ul>
        </div>
        <ul class="search-ul">
          <p q-show="jsonFail" style="padding: 20px; font-size: 12px;">
            缺失模块。<br/>1、请确保node版本大于6.2<br/>2、在博客根目录（注意不是yilia-plus根目录）执行以下命令：<br/> npm i hexo-generator-json-content --save<br/><br/>
            3、在根目录_config.yml里添加配置：
<pre style="font-size: 12px;" q-show="jsonFail">
  jsonContent:
    meta: false
    pages: false
    posts:
      title: true
      date: true
      path: true
      text: false
      raw: false
      content: false
      slug: false
      updated: false
      comments: false
      link: false
      permalink: false
      excerpt: false
      categories: false
      tags: true
</pre>
          </p>
          <li class="search-li" q-repeat="items" q-show="isShow">
            <a q-attr="href:path|urlformat" class="search-title"><i class="icon-quo-left icon"></i><span q-text="title"></span></a>
            <p class="search-time">
              <i class="icon-calendar icon"></i>
              <span q-text="date|dateformat"></span>
            </p>
            <p class="search-tag">
              <i class="icon-price-tags icon"></i>
              <span q-repeat="tags" q-on="click:choseTag(e, name)" q-text="name|tagformat"></span>
            </p>
          </li>
        </ul>
    	</section>
    

    
    	<section class="tools-section tools-section-friends" q-show="friends">
  		
        <ul class="search-ul">
          
            <li class="search-li">
              <a href="https://www.processon.com/diagrams" target="_blank" class="search-title" >
                
                  <i class="icon-link icon"></i>
                
                思维导图
              </a>
            </li>
          
            <li class="search-li">
              <a href="https://www.pdfpai.com/" target="_blank" class="search-title" >
                
                  <i class="icon-link icon"></i>
                
                PDF工具
              </a>
            </li>
          
            <li class="search-li">
              <a href="/kapwing" target="_blank" class="search-title" >
                
                  <i class="icon-link icon"></i>
                
                无损放大
              </a>
            </li>
          
            <li class="search-li">
              <a href="https://codeimg.io/" target="_blank" class="search-title" >
                
                  <i class="icon-link icon"></i>
                
                代码转图
              </a>
            </li>
          
            <li class="search-li">
              <a href="https://freessl.cn/" target="_blank" class="search-title" >
                
                  <i class="icon-link icon"></i>
                
                HTTPS证书
              </a>
            </li>
          
        </ul>
  		
    	</section>
    

    
  </div>
  
</div>
    <!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                      <div class="pswp__preloader__cut">
                        <div class="pswp__preloader__donut"></div>
                      </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div> 
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>
  </div>

  
  
<script type="text/javascript" src="/plugins/activate-power-mode/activate-power-mode.js"></script>
<script>
  POWERMODE.colorful = true; // make power mode colorful
  POWERMODE.shake = false; // turn off shake
  document.body.addEventListener('input', POWERMODE);
</script>

  
  <!-- <script async type="text/javascript" size="90" alpha="0.2" zIndex="0" src="/plugins/ribbon.js/ribbon.min.js"></script> -->
  
  
  
  <script type="text/javascript" src="/lib/snow.js"></script>
  <script type="text/javascript" src="/lib/jquery-2.1.4.min.js"></script>
  <script>
    snow.down();
    $(window).resize(function() {
      $("canvas").css("z-index","500").remove();
      snow.down();
    });
  </script>
  
</body>

</html>
